Ubuntu创建root用户

sudo passwd root

显示

Enter new UNIX password: 

设置root用户密码,终端显示

Retype new UNIX password: 

再输入一遍,显示

passwd: password updated successfully

表示root用户成功创建并设置密码

验证:输入su,终端显示password,输入刚刚设置的root密码,没有错误提示,并且#即代表当前用户有root权限

在ubuntu系统中,默认是不开启ssh使用root用户登陆的,在/etc/ssh/sshd_config配置文件中如下配置:

# Authentication:
LoginGraceTime 120

PermitRootLogin without-password
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes

很多时候需要允许root用户登陆,需要将PermitRootLogin without-password修改为PermitRootLogin yes.然后重启ssh,sudo service ssh restart.这样就可以使用root用户登陆了

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容