ubuntu系统云服务器切换root用户登录

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/m0_37422289/article/details/82017242
  1. 默认用户登录(如,ubuntu)
  2. 设置root用户密码
sudo passwd root

输入密码, 再重复确认输入一次
3. 允许root远程登录

sudo vi /etc/ssh/sshd_config

将PermitRootLogin 置为yes

# Authentication:
LoginGraceTime 120
# PermitRootLogin prohibit-password
PermitRootLogin yes
StrictModes yes

保存退出.
4. 重启ssh服务

sudo service ssh restart
  1. 使用mobaxterm等远程桌面以root身份登录

猜你喜欢

转载自blog.csdn.net/m0_37422289/article/details/82017242
今日推荐