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用戶密碼
相關文章
相關標籤/搜索