1、修改sshd_config文件。
(1)先備份舊文件蜈彼,以做對比:
cd /etc/ssh?
cp sshd_config sshd_config_lod
(2)編輯文件
vi /etc/ssh/sshd_config
(3)修改內(nèi)容
通過按鍵盤上的insert鍵來改變編輯狀態(tài)终娃,插入和替換服傍,一定要注意狀態(tài)卷雕!
將#PasswordAuthentication no的注釋去掉节猿,并且將NO修改為YES ?
修改后的配置為:
PasswordAuthentication Yes
將#PermitRootLogin yes的注釋去掉 //我的kali中默認(rèn)去掉了注釋
PermitRootLogin yes
(4)將服務(wù)加入到自動啟動
執(zhí)行以后命令進行開始和關(guān)閉
update-rc.d ssh enable? //系統(tǒng)自動啟動SSH服務(wù)
update-rc.d ssh disabled // 關(guān)閉系統(tǒng)自動啟動SSH服務(wù)
(5)啟動SSH服務(wù)
/etc/init.d/ssh start ?
/etc/init.d/ssh restart //如果前面啟動了,則需要重新啟動
或者
service ssh start
(6)驗證SSH服務(wù)狀態(tài)
/etc/init.d/ssh status
2.某些舊版本的ssh客戶端無法直接連接kali ?ssh爽蝴,需要使用新版本的工具連接即可!