1、安装openssh-server插件开启22端口访问
# 安装ssh会默认启动服务并开启22端口apt updateapt install openssh-server
2、开启root用户远程访问
激活root用户,设置root用户登录密码hunter@localhost:/$ sudo passwd rootNew 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-passwordPermitRootLogin yes#StrictModes yes#MaxAuthTries 6#MaxSessions 10......
3、重启 ssh 服务
service ssh restart