跳到主要內容

發表文章

目前顯示的是有「OS AutoLogin」標籤的文章

ShellScript-Linux AutoLogin

Problem 為了利於測試,先前做過各個不同作業系統的自動登入( link )。隨著測試機逐日增加,為了節省時間與練習shellscript,因此決定寫一個script將設置自動登入的動作給簡單化。但面對不同的Linux,會有不同的自動登入方式,我也很直接的針對不同Distribution使用不同的做法。目前我所支援的作業系統為SLES11、RHEL5、RHEL6、CentOS5、CentOS6。 How to? 確認Linux Distribution 首先我們可以透過/etc/issue去判斷作業系統版本。以下是我收集的資訊: Welcome to SUSE Linux Enterprise Server 10 SP2 Welcome to SUSE Linux Enterprise Server 11 SP2 Red Hat Enterprise Linux Server release 6.0 Red Hat Enterprise Linux Server release 5.6 CentOS release 5.6 CentOS Linux release 6.0 作法是透過grep指令去判斷/etc/issue檔案是否有出現對應的OS Pattern。SLES判斷是否有SUSE;CentOS/RHEL則是判斷開頭字串與主要版本號;其它的顯示不支援。找到對應的Distribution後就呼叫對應的function。這裡設置OS_INFO_FILE變數為$1與將實際操作寫為各個function,主要是為了便於測試,不然系統檔改壞就要DRBL了。 OS_INFO_FILE = $1 if [ "$1" == "" ] ; then OS_INFO_FILE = / etc / issue fi   if grep SUSE $OS_INFO_FILE > / dev / null; then setupAL_SLES elif grep -e "\(CentOS\)\|\(Red Hat\).*5\.*" $OS_INFO_FILE > / dev / null; then setupAL_RHEL5 elif grep -e ...

How to login to OS automatically?

Windows 前言 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為登入密碼。 Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] "AutoAdminLogon"="1" "DefaultUserName"="Administrator" "DefaultPassword"="123456" Modify Local Security Policy 在Windows2003或2008中,因為安全性的考量,系統會將一些設定disable/enable。為了達到AutoLogin我們必須去關掉某些設定。 首先到Administrative Tools>Local Security Policy中,如果不想常常改密碼,可以將Account Policies>Password Policy中的Minimum password age修改為0。 接著將Local Policies>Security Option中的Interactive logon: Do not require CTRL+ALT+DEL給Enable。在啟動系統後就不會要求你要先輸入CTRL+ALT+DEL才能Login。 Method 2 透過control userpasswords2指令去設定。...