在研究Linux安全的時候遇到一個問題,原本打算修改linux直接遠程root登陸,修改為sshd的配置文件后
Nano /etc/ssh/sshd_config
把#PermitRootLogin yes 修改為PermitRootLogin no 修改完成后,保存退出 重啟sshd service sshd restart
新建一個普通用戶
Useradd unixbar Passwd unixbar
在securecrt遠程工具中,使用普通用戶登陸的時候,出現了
The server has disconnected with an error. Server message reads: A protocol error occurred. Change of username or service not allowed: (shang1,ssh-connection) -> (shang,ssh-connection)
這樣類似的錯誤。
這是由於securecrt設置的原因導致的。把你的用戶名改成unixbar。就可以了,這樣做了以后就可以實現禁止root遠程登陸: