第一步:通过命令vim /etc/ssh/sshd_config打开ssh端口修改配置
第二步:修改打开的文档中的两处并保存退出<
①.将PermitRootLogin后边的no改成yes
②.将#PasswordAuthentication yes 前边#的注释去掉
③.:q!保存退出<
第三步:重新启动ssh端口34;/etc/init.d/ssh start34;</h4>
第四步:将ssh端口设置开机自动启动34;update-rc.d ssh enable34;重启kali
</p>
<h4 id="%E7%AC%AC%E4%B8%80%E6%AD%A5%EF%BC%9A%E9%80%9A%E8%BF%87%E5%91%BD%E4%BB%A4vim%20%2Fetc%2Fssh%2Fsshd_config%E6%89%93%E5%BC%80ssh%E7%AB%AF%E5%8F%A3%E4%BF%AE%E6%94%B9%E9%85%8D%E7%BD%AE">第一步:通过命令vim /etc/ssh/sshd_config打开ssh端口修改配置</h4>
<img alt="" height="943" src="https:/
/img-blog.csdnimg.cn/ef6f24dea0364930889e109d4a95d95d.png" width="1200" />
<h4 id="%E7%AC%AC%E4%BA%8C%E6%AD%A5%3A%E4%BF%AE%E6%94%B9%E6%89%93%E5%BC%80%E7%9A%84%E6%96%87%E6%A1%A3%E4%B8%AD%E7%9A%84%E4%B8%A4%E5%A4%84%E5%B9%B6%E4%BF%9D%E5%AD%98%E9%80%80%E5%87%BA">第二步:修改打开的文档中的两处并保存退出
①.将PermitRootLogin后边的no改成yes
<img alt="
" height="949" src="https:<span class="hljs-comment">//img-blog.csdnimg.cn/9ad814a9e1b04d0d9b76937f196bcfc5.png" width="1200" />
②.将#PasswordAuthentication yes 前边#的注释去掉</p>
<img alt="" height="955" src="https:/
/img-blog.csdnimg.cn/aaf123c5e6584799a1f24b578e5a3c3f.png" width="1200" />
③.:q!保存退出
<img alt="" height="923" src="https:<span class="hljs-comment">//img-blog.csdnimg.cn/d5001fa3ef0b486eaabe87873748f0cc.png" width="1200" />
<h4 id="%E7%AC%AC%E4%B8%89%E6%AD%A5%EF%BC%9A%E9%87%8D%E6%96%B0%E5%90%AF%E5%8A%A8ssh%E7%AB%AF%E5%8F%A3%22%2Fetc%2Finit.d%2Fssh%20start%22">第三步:重新启动ssh端口34;/etc/init.d/ssh start34;</h4>
<img alt="" height="70" src="https://img-blog.csdnimg.cn/0d58a811a78e4d1a9e226a873659106b.png" width="446" /></p>
<h4 id="%E7%AC%AC%E5%9B%9B%E6%AD%A5%3A%E5%B0%86ssh%E7%AB%AF%E5%8F%A3%E8%AE%BE%E7%BD%AE%E5%BC%80%E6%9C%BA%E8%87%AA%E5%8A%A8%E5%90%AF%E5%8A%A8%22update-rc.d%20ssh%20enable%22%E9%87%8D%E5%90%AFkali">第四步:将ssh端口设置开机自动启动34;update-rc.d ssh enable34;重启kali</h4>
<img alt="" height="42" src="https:/
/img-blog.csdnimg.cn/d9c47a4b83974fa389b2ab6b85072876.png" width="349" />
<h4 id="%E7%AC%AC%E4%BA%94%E6%AD%A5%EF%BC%9A%E9%80%9A%E8%BF%87%E5%91%BD%E4%BB%A4service%20ssh%20status%E6%A3%80%E6%B5%8Bssh%E7%AB%AF%E5%8F%A3%E6%98%AF%E5%90%A6%E6%89%93%E5%BC%80%EF%BC%88%E5%9B%BE%E7%A4%BA%E4%B8%BA%E6%89%93%E5%BC%80%E7%8A%B6%E6%80%81%EF%BC%89">第五步:通过命令service ssh status检测ssh端口是否打开(图示为打开状态)
<img alt="
" height="305" src="https:<span class="hljs-comment">//img-blog.csdnimg.cn/a9dbb8cf25c94bd0a46560b79199ce7a.png" width="646" />
<h4 id="%E7%AC%AC%E5%85%AD%E6%AD%A5%EF%BC%9A%E9%80%9A%E8%BF%87%22ifconfig%22%E6%9F%A5%E7%9C%8Bkali%E7%9A%84IP%E5%9C%B0%E5%9D%80(192.168.98.128)">第六步:通过34;ifconfig34;查看kali的IP地址(192.168.98.128)</h4>
<img alt="" height="335" src="https:/
/img-blog.csdnimg.cn/fec45b13d21b417d89dd525783e99b91.png" width="625" />
<h4 id="%E7%AC%AC%E4%B8%83%E6%AD%A5%EF%BC%9A%E6%89%93%E5%BC%80XShell%E5%A1%AB%E5%85%A5%E5%90%8D%E7%A7%B0%EF%BC%8Ckali%E7%9A%84IP%E5%9C%B0%E5%9D%80%20%E5%A1%AB%E5%AE%8C%E4%BB%A5%E5%90%8E%E5%85%B6%E4%BB%96%E9%BB%98%E8%AE%A4%E7%9B%B4%E6%8E%A5%E8%BF%9E%E6%8E%A5">第七步:打开XShell填入名称,kali的IP地址 填完以后其他默认直接连接
<img alt="
" height="824" src="https:<span class="hljs-comment">//img-blog.csdnimg.cn/f129570b12d04992bf23fad83c842907.png" width="852" />
<h4 id="%E7%AC%AC%E5%85%AB%E6%AD%A5%EF%BC%9A%E7%82%B9%E5%87%BB%E8%BF%9E%E6%8E%A5%E4%BB%A5%E5%90%8E%E2%80%94%E6%8E%A5%E5%8F%97%E4%B8%8E%E4%BF%9D%E5%AD%98%E2%80%94%E5%A1%AB%E5%85%A5%E8%A6%81%E8%BF%9E%E6%8E%A5%E7%9A%84%E7%94%A8%E6%88%B7%E6%9C%BA%E5%90%8D%E7%A7%B0(kali)%E2%80%94%E5%A1%AB%E5%85%A5%E8%BF%9E%E6%8E%A5%E7%94%A8%E6%88%B7%E6%9C%BA%E5%AF%86%E7%A0%81(kali)">第八步:点击连接以后—接受与保存—填入要连接的用户机名称(kali)—填入连接用户机密码(kali)</h4>
<img alt="" height="658" src="https:/
/img-blog.csdnimg.cn/1e0d850d1f304627ad7dff9a4decffa9.png" width="681" />
<img alt="
" height="333" src="https:<span class="hljs-comment">//img-blog.csdnimg.cn/5a242b0129ff43b2aba0c8dafa4a9e08.png" width="526" />
<img alt="" height="597" src="https://img-blog.csdnimg.cn/c06beef597704671a3e639d46a8d74f9.png" width="648" /></p>
<h4 id="%E7%AC%AC%E4%B9%9D%E6%AD%A5%EF%BC%9A%E5%A6%82%E5%9B%BE%E6%89%80%E7%A4%BA%E8%BF%9E%E6%8E%A5%E6%88%90%E5%8A%9F%E3%80%82">第九步:如图所示连接成功。</h4>
<img alt="" height="765" src="https:/
/img-blog.csdnimg.cn/913556422f9c4edf8d74cb70b77e2f9c.png" width="980" />
注:如果之前配置过kali的ssh端口可从第三步直接开始连接