ubuntu server 16.04 開啟root密碼登錄


0x00 ubuntu server 16.04 開啟root密碼登錄

由於眾多VPS默認使用證書驗證登錄,雖然安全但使用十分不便,所以特提供開啟root用戶並使用密碼登錄方法。

0x01 為root賬戶設置密碼

$ sudo passwd root

0x02 進入root賬戶

$ su root

0x03 編輯sshd_config文件

$ vi /etc/ssh/sshd_config
做如下修改:

1.允許root賬戶登錄
PermitRootLogin without-password
~修改為~
PermitRootLogin yes

2.允許密碼登錄
PasswordAuthentication no
~修改為~
PasswordAuthentication yes

3.關閉證書驗證登錄(::確認可以使用密碼登錄后再做此修改,避免發生無法登錄服務器的驗證后果::)
UsePAM yes
~修改為~
UsePAM no

0x04 重啟sshd服務

$ sudo service ssh restart

本文轉載自http://kiros.onbeta.com/Linux/ubuntu-server-1604-kai-qiroot-mi-ma-deng-lu.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM