ssh远程连接kali
1.首先安装ssh服务
root@kali:~# apt-get -y install ssh
Reading package lists... Done
Building dependency tree
Reading state information... Done
ssh is already the newest version (1:7.9p1-4).
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
root@kali:~#
这里提示我已经安装过
2.开启ssh服务
root@kali:~# systemctl start ssh
root@kali:~#
3.开机自启ssh服务
root@kali:~# systemctl enable ssh
Synchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable ssh
root@kali:~#
4.查看22号端口是否开启
root@kali:~# netstat -nlt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
root@kali:~#
22号端口已开启
5.修改配置文件vim /etc/ssh/sshd_config
虽然开启了22号端口,但还是不能访问。因为Kali采用的是 debian的内核, 默认情况下是无法通过 ssh 远程登录 root 用户
需要修改 ssh 的配置文件
将PasswordAuthentication yes前面的注释“#”号删除
root@kali:~# vim /etc/ssh/sshd_config
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
#PermitEmptyPasswords no
并将#PermitRootLogin prohibit-password
改为PermitRootLogin yes
保存并退出
重启ssh服务
root@kali:~# systemctl restart ssh
root@kali:~#
登录成功: