天天看點

Debian 9允許root使用者登入和以ssh方式登入

1.允許以root使用者登入作業系統

預設情況下debian是不允許以root使用者登入的,隻能以其他使用者登入系統中,然後su到root使用者下進行操作。

1.1修改/etc/gdm3/daemon.conf檔案

新增下面一行AllowRoot = true      
[security]
AllowRoot = true      

1.2修改/etc/pam.d/gdm-password

注釋掉下面内容

/#auth  required  pam_succeed_if.so user != root quiet_success      

然後重新開機作業系統,就可以使用root使用者登入作業系統了。

2.以root身份通過ssh登入作業系統

2.1修改/etc/ssh/sshd_config

/#PermitRootLogin prohibit-password      

修改為

PermitRootLogin yes      

2.2重新開機ssh即可

service sshd restart      
/etc/init.d/ssh restart      

繼續閱讀