????????1.使用 netstat -lnt? 查看當(dāng)前Kali系統(tǒng)開放的端口?
2.修改SSH配置文件
打開Kali命令行 輸入? ?vi /etc/ssh/sshd_config? ? 回車
找到圖二代碼位置 按i鍵進入編輯模式? 刪除掉#
然后找到圖三代碼位置 刪除掉# 將后面prohi********修改為yes
再按 esc 輸入 :wq 保存并退出
在命令行下輸入??
/etc/init.d/ssh start??
或
service ssh start
啟動SSH服務(wù)
Starting ssh (via systemctl): ssh.service.
輸入 /etc/init.d/status 查看服務(wù)是否成功啟動
出現(xiàn)如下提升則服務(wù)啟動成功
● ssh.service - OpenBSD Secure Shell server
? Loaded: loaded (/lib/systemd/system/ssh.service; disabled; vendor preset: disabled)
? Active: active (running) since Sun 2020-03-01 16:27:53 CST; 3s ago
? ? Docs: man:sshd(8)
? ? ? ? ? man:sshd_config(5)
? Process: 1746 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 1747 (sshd)
? ? Tasks: 1 (limit: 3461)
? Memory: 1.5M
? CGroup: /system.slice/ssh.service
? ? ? ? ? └─1747 /usr/sbin/sshd -D
3月 01 16:27:53 192 systemd[1]: Starting OpenBSD Secure Shell server...
3月 01 16:27:53 192 sshd[1747]: Server listening on 0.0.0.0 port 22.
3月 01 16:27:53 192 sshd[1747]: Server listening on :: port 22.
3月 01 16:27:53 192 systemd[1]: Started OpenBSD Secure Shell server.
輸入? ?update-rc.d ssh enable? 設(shè)置ssh服務(wù)為開機自啟
到此SSH服務(wù)就開啟成功
可以使用Xshell鏈接啦