使用root账号进入ubuntu。
adduser xshell
添加成功
passwd xshell
输入密码和确认密码,其他可以不填,然后输入y确认添加成功。
root@homestead:/home/vagrant# adduser xshell
Adding user `xshell' ...
Adding new group `xshell' (1000) ...
Adding new user `xshell' (1000) with group `xshell' ...
Creating home directory `/home/xshell' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for xshell
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y
新用户修改成ROOT权限(新账号要使用sudo)
vim /etc/sudoers
在root 账号增加xshell(用户名 ALL=(ALL:ALL) ALL)
root ALL=(ALL:ALL) ALL
xshell ALL=(ALL:ALL) ALL
vim 保存失败的话使用 wq!