1、安装openssh-server插件开启22端口访问
# 安装ssh会默认启动服务并开启22端口
apt update
apt install openssh-server
** 2、开启root用户远程访问**
- 激活root用户,设置root用户登录密码
hunter@localhost:/$ sudo passwd root
New password:
Retype new password:
- 修改配置
找到配置文件/etc/ssh/sshd_config,打开注释 #PermitRootLogin prohibit-password,并修改为
PermitRootLogin yes
hunter@hunter-SER:/$ cat /etc/ssh/sshd_config
......
#LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
......
3、重启 ssh 服务
service ssh restart
本文转载自: https://blog.csdn.net/qq_32944025/article/details/142436234
版权归原作者 Hunter4J 所有, 如有侵权,请联系我们删除。
版权归原作者 Hunter4J 所有, 如有侵权,请联系我们删除。