kali linux开启ssh服务
步骤1 打开终端 切换 root
在终端内·输入
sudo systemctl enable ssh 回车 开启ssh服务![]()
步骤2
查看ssh开启没
命令是 systemctl status ssh
步骤3
开启ssh服务步骤
输入下面命令启动 SSHsudo systemctl start ssh
再次查看SSH服务状态systemctl status ssh
已开启ssh服务![]()
注意:kali默认是禁止直接用root用户远程登陆的,想要实现root用户的远程登陆只需要修改 /etc/ssh/sshd_config ssh服务的配置文件即可,具体步骤:
1.
打开终端切换至
root
用户
su root
2.
编辑
sshd_config
文件
vim /etc/ssh/sshd_config
![3fc58ac270384fb28d8da1341fcac457.png](https://img-blog.csdnimg.cn/3fc58ac270384fb28d8da1341fcac457.png)
显示行号命令是按ESC 然后:set nu +回车
![54aa73c985e84403baa6b356f62cc86b.png](https://img-blog.csdnimg.cn/54aa73c985e84403baa6b356f62cc86b.png)
用
#
号注释掉第
34
行下面 (找到第34行)
加入:
permitRootLogin yes
![7428b36ad61e4793a2230b89ff7c1aa1.png](https://img-blog.csdnimg.cn/7428b36ad61e4793a2230b89ff7c1aa1.png)
然后ESC :wq! 回车保存
![f4420d47e9754867bd4c78fcf082bd08.png](https://img-blog.csdnimg.cn/f4420d47e9754867bd4c78fcf082bd08.png)
3.
重新载入配置文件使之生效
systemctl reload ssh +回车
![03d0cfbb09ec4c43ae54b448e1db6d68.png](https://img-blog.csdnimg.cn/03d0cfbb09ec4c43ae54b448e1db6d68.png)
接下来咱们用xshell 连接kali的ssh首先咱们要看一下kali linux 的ip地址查看命令是 ifconfig这里显示kali linux 的ip地址![]()
接下来 咱们要用这个ip地址来连接xshell让我们在真实机打开xshell然后点击 左上角的新建
然后 弹出 点击接受并保存![]()
点击输入你的用户名 点确定
输入你的kali linux 用户密码 点确定
完成 连接成功