一、切換到root用戶
sudo su
二、添加一個新用戶
useradd frontng
三、爲該用戶設置密碼
passwd frontng
提示輸入密碼
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
四、賦予root權限
vim /etc/sudoers
修改文件如下:
# User privilege specification
root ALL=(ALL) ALL
frontng ALL=(ALL) AL
五、設置用戶的主目錄
usermod -d /home/frontng frontng
六、設置用戶的默認命令解釋程序(通常是bash)
usermod -s /bin/bash frontng
七、登錄並切換到root權限
ssh [email protected]
#輸入frontng用戶密碼
sudo su
#輸入frontng用戶密碼