Ubuntu 添加新用户并赋予root权限

1、切换到root用户
sudo su
2、添加一个新用户
useradd frontng
3、为该用户设置密码
passwd frontng

提示输入密码vim

Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
4、赋予root权限
vim /etc/sudoers

修改文件以下:bash

# User privilege specification
root ALL=(ALL) ALL
frontng ALL=(ALL) AL
5、设置用户的主目录
usermod -d /home/frontng frontng
6、设置用户的默认命令解释程序(一般是bash)
usermod -s /bin/bash frontng

7、登陆并切换到root权限
ssh frontng@xxx.xxx.xxx.xxx
#输入frontng用户密码
sudo su
#输入frontng用户密码
相关文章
相关标签/搜索