Home 腾讯云ubuntu系统设置root登录
Post
Cancel

腾讯云ubuntu系统设置root登录

腾讯云主机,选择ubuntu系统之后,默认登录的用户都是ubuntu用户,如果想直接使用root用户,必须要手动切换,并且不可以直接登录root用户。若想直接使用root账户进行登录,则需要自己进行一些相关配置

首先要确保已有root账户,然后切换到root账户下

1
su root

修改ssh配置

1
sudo vim /etc/ssh/sshd_config

修改PermitRootLogin参数

1
2
3
4
5
6
# 搜索找到对应位置
/PermitRootLogin
# 把此熟悉设置为true,若没有自己手动添加一行
PermitRootLogin true
# 保存并退出
:wq

重启ssh服务

1
sudo service ssh restart
This post is licensed under CC BY 4.0 by the author.