前言
在Linux
启动ssh
服务
RedHat系列
安装 openssh
1
| yum install openssh-server
|
修改配置
编辑配置文件
1
| vim /etc/ssh/sshd_config
|
去除端口号注释
去除监听地址注释
1 2
| ListenAddress 0.0.0.0 ListenAddress ::
|
允许远程登录
允许使用密码验证身份
1
| PasswordAuthentication yes
|
启动 sshd 服务
Debian系列
安装 openssh
1 2
| apt-get install openssh-client apt-get install openssh-server
|
编辑配置文件
1
| vim /etc/ssh/sshd_config
|
修改配置文件
去除端口号注释
去除监听地址注释
1 2
| ListenAddress 0.0.0.0 ListenAddress ::
|
允许通过root身份远程登录
- 去掉
PermitRootLogin without-password
前面的#
并修改为PermitRootLogin yes
Kali要严格的将PermitRootLogin prohibit-password
改为PermitRootLogin yes
才能实现远程使用root身份登陆
重启 ssh 服务
1 2
| /etc/init.d/ssh restart service ssh restart
|
查看 ssh 状态
设置开机自启
1
| sudo systemctl enable ssh
|
完成
参考文献
CSDN——dh2580
博客园——殷大侠
CSDN——fandroid
CSDN——Tz.