系统相关
首页 > 系统相关> > Ubuntu 18 开启root和ssh

Ubuntu 18 开启root和ssh

作者:互联网


一、安装ssh
18.04

apt install openssh-server  

二、开启Ubuntu的root密码
首先启用root密码,切换到root用户

sudo su 

修改root用户的密码

passwd root

两次输入root密码即可

三、修改ssh的配置文件
 

etc/ssh/sshd_config

原文件修改前

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

原文件修改后

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes
StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

四、重新启动ssh服务
service sshd restart


 

标签:18,密码,PermitRootLogin,ssh,yes,原文件,root
来源: https://blog.csdn.net/zsgcsdn/article/details/120172923