ubuntu18.04连接SSH

Posted 陵游gentian

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ubuntu18.04连接SSH相关的知识,希望对你有一定的参考价值。

文章目录


Ubuntu18.04,出于安全预防措施,ssh 禁止 root 登陆

安装

安装 openssh-server

sudo apt install openssh-server

安装 ssh 客户端

sudo apt install ssh

修改配置文件

修改 /etc/ssh下的 sshd_config
将其中

#PermitRootLogin prohibit-password

去掉注释,并且把 prohibit-password 改为 yes,变完之后如下:

PermitRootLogin yes

重启 ssh 服务

sudo systemd restart sshd

以上是关于ubuntu18.04连接SSH的主要内容,如果未能解决你的问题,请参考以下文章