差異處
這裏顯示兩個版本的差異處。
pc:autologin:main [2013/02/24 23:38] tony |
pc:autologin:main [2023/06/25 09:48] |
||
---|---|---|---|
行 1: | 行 1: | ||
- | {{tag>Computer OS_Autologin}} | ||
- | ====== How to login to OS automatically? ====== | ||
- | ===== Windows ===== | ||
- | ==== Preface ==== | ||
- | Windows要做到自動登入,不同版本Windows其實大同小異。但有一個最重要的是:必須是正版的Windows,否則會跳出盜版之類的訊息。 | ||
- | ==== Method 1 ==== | ||
- | === Modify Registry === | ||
- | 新增三個Type String的Registry到\KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon中,\\ | ||
- | AutoAdminLogin: 1\\ | ||
- | DefaultUserName: administrator \\ | ||
- | DefaultPassword: 123456\\ | ||
- | AutoAdminLogin為開啟自動登入;DefaultUserName為登入帳號;DefaultPassword為登入密碼。\\ | ||
- | {{:pc:autologin:autologin_registry.png?600|}}\\ | ||
- | <code> | ||
- | Windows Registry Editor Version 5.00 | ||
- | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] | ||
- | "AutoAdminLogon"="1" | ||
- | "DefaultUserName"="Administrator" | ||
- | "DefaultPassword"="123456" | ||
- | </code> | ||
- | === Modify Local Security Policy === | ||
- | 在Windows2003或2008中,因為安全性的考量,系統會將一些設定disable/enable。為了達到AutoLogin我們必須去關掉某些設定。\\ | ||
- | 首先到Administrative Tools>Local Security Policy中,如果不想常常改密碼,可以將Account Policies>Password Policy中的Minimum password age修改為0。\\ | ||
- | {{:pc:autologin:minpassword.png?600|}} | ||
- | |||
- | 接著將Local Policies>Security Option中的Interactive logon: Do not require CTRL+ALT+DEL給Enable。在啟動系統後就不會要求你要先輸入CTRL+ALT+DEL才能Login。\\ | ||
- | {{:pc:autologin:cad_enable.png?600|}} | ||
- | |||
- | ==== Method 2 ==== | ||
- | 透過control userpasswords2指令去設定。\\ | ||
- | [[http://www.lhu.edu.tw/i/teach-online/xp_autologin.htm]]\\ | ||
- | 在Win7、XP、Win2008 R2上測試過可行。 | ||
- | |||
- | ==== Method 3 ==== | ||
- | 執行以下script,default user名稱可根據喜好自行決定是否使用。 | ||
- | <code bash autologin.bat> | ||
- | reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1 /f | ||
- | reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d administrator /f | ||
- | </code> | ||
- | |||
- | ===== Linux ===== | ||
- | ==== Preface ==== | ||
- | Linux的自動登入最為複雜,會因為它版本、Distribution的不同,而要有不同的修改。 | ||
- | ==== RHEL&CentOS 5.x ==== | ||
- | <code bash> | ||
- | #vim /etc/inittab | ||
- | id:3:initdefault: | ||
- | 1:2345:respawn:/sbin/mingetty --autologin root tty1 | ||
- | #vim /root/.bash_profile | ||
- | if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ] | ||
- | then | ||
- | startx | ||
- | fi | ||
- | </code> | ||
- | ==== RHEL&CentOS 6.x ==== | ||
- | === Method 1 === | ||
- | - 修改/etc/inittab<code bash>id:3:initdefault</code> | ||
- | - 修改/etc/init/tty.conf<code bash>stop on runlevel [2345] | ||
- | respawn | ||
- | instance /dev/tty1 | ||
- | exec /sbin/mingetty --noclear --autologin=root /dev/tty1</code> | ||
- | - 執行<code bash>echo "startx" >> /root/.bash_profile</code> | ||
- | === Method 2 === | ||
- | 修改/etc/gdm/custom.conf | ||
- | <code bash> | ||
- | [daemon] | ||
- | AutomaticLoginEnable=True | ||
- | AutomaticLogin=root | ||
- | </code> | ||
- | AutomaticLogin填的是要自動登入的user名稱。 | ||
- | ==== SLES11 ==== | ||
- | 最簡單的莫過於它,將/etc/sysconfig/displaymanage中的DISPLAYMANAGER_AUTOLOGIN屬性修改為要自動登入的帳號即可。\\ | ||
- | {{:pc:autologin:sles11_displaymanager.png?600|}}\\ | ||
- | |||
- | ===== Reference ===== | ||
- | * [[http://sudhaker.com/23/centos-rhel-6-autologin|CentOS/RHEL6 Autologin]] | ||
- | * [[http://blog.csdn.net/kpshare/article/details/7523546|linux autologin with root]] | ||
- | |||
- | ===== ===== | ||
- | ---- | ||
- | \\ | ||
- | ~~DISQUS~~ |