Kali2023使用SSH连接

Linux · 2024-11-21
Kali2023使用SSH连接

第一步、切换root权限

切换root权限

sudo su
2024-01-15T12:20:51.png

# 给root设置密码
passwd
2024-01-15T12:21:12.png

第二步:修改ssh配置文件
vim /etc/ssh/sshd_config

显示行号

2024-01-15T12:21:46.png

修改ssh项

2024-01-15T12:22:07.png

第三步、重启ssh服务,设置开机自启动,查看ssh服务状态
systemctl restart ssh && systemctl enable ssh && systemctl status ssh
最终结果:
2024-01-15T12:22:44.png

第四步:ssh连接kali

协议 用户名@ip地址

ssh [email protected]
2024-01-15T12:23:06.png

开机自动启动ssh命令

sudo systemctl enable ssh

关闭ssh开机自动启动命令

sudo systemctl disable ssh

单次开启ssh

sudo systemctl start ssh

单次关闭ssh

sudo systemctl stop ssh

设置好后重启系统

reboot

查看ssh是否启动,看到Active: active (running)即表示成功

sudo systemctl status ssh

Theme Jasmine by Kent Liao