在Ubuntu中允許root遠程訪問
如果使用如xshell等遠程工具首次通過root連接Ubuntu會提示拒絕訪問,並不是密碼不正確,而是Ubuntu默認禁止以root遠程連接。
我們可以進行適當的配置來使root遠程連接可用。
1.首先在本機使用root修改/etc/ssh/sshd_config文件。
vim /etc/ssh/sshd_config
將PermitRootLogin的值改爲yes,將PermitEmptyPasswords修改爲no(原來就是no則不用修改),然後保存退出。
2.重啓ssh服務
service ssh restart
3.使用xshell重新嘗試即可。