在蘋果透過指令關閉自動登入

在我的電腦裡面會有 myguest 這個帳號自動登入. 可以用下列指令查看目前自動登入設定狀況.

# defaults read /Library/Preferences/com.apple.loginwindow
{
    MCXLaunchOnUserLogout =     {
        myguest = 1;
    };
    OptimizerLastRunForBuild = 23085024;
    OptimizerLastRunForSystem = 168230912;
    PowerOffDisabled = 1;
    RetriesUntilHint = 3;
    autoLoginUser = myguest;
    lastUser = loggedIn;
    lastUserName = myguest;
}

透過下列指令就可以把字懂登入關閉

# defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser

在查看一次登入設定. myguest 已經從自動登入移除.

# defaults read /Library/Preferences/com.apple.loginwindow
{
    MCXLaunchOnUserLogout =     {
        myguest = 1;
    };
    OptimizerLastRunForBuild = 23085024;
    OptimizerLastRunForSystem = 168230912;
    PowerOffDisabled = 1;
    RetriesUntilHint = 3;
    lastUser = loggedIn;
    lastUserName = myguest;
}