默認是無法root用戶連接ssh的 但是可以修改配置文件來確保可以 root連接
但是修改後每次重啓系統似乎都無法連接
必須執行 /etc/init.d/ssh restart 才能正常連接
所以我就像如何在啓動時就自動執行這個命令
網上有的說在 /etc/rc.local 下添加命令 但是不是所以linxu都有 /etc/rc.local 這個文件
在 profil.d 裏添加自己的shell腳本就可以了
root@kali:/etc# cd profile.d/
root@kali:/etc/profile.d# vim myssh.sh
可以嘗試下面命令來看看是否編寫正確
/bin/bash myssh.sh
成功開機自啓!