[b]增加新用户,使用adduser命令:[/b]
root@AY130925102139735305Z:/home# [b]sudo adduser xusongqin[/b]
Adding user `xusongqin' ...
Adding new group `xusongqin' (1000) ...
Adding new user `xusongqin' (1000) with group `xusongqin' ...
Creating home directory `/home/xusongqin' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for xusongqin
Enter the new value, or press ENTER for the default
Full Name []: [b]xusongqin[/b]
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] [b]Y[/b]
root@AY130925102139735305Z:/home# [b]ls[/b]
xusongqin
[b]为该用户增加sudo权限:[/b]
root@AY130925102139735305Z:[b]vi /etc/sudoers [/b]
##为用户添加sudo权限 xusongqin ALL=(ALL:ALL) ALL
# User privilege specification
root ALL=(ALL:ALL) ALL
[b]xusongqin ALL=(ALL:ALL) ALL[/b]
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
root@AY130925102139735305Z:/home# [b]sudo adduser xusongqin[/b]
Adding user `xusongqin' ...
Adding new group `xusongqin' (1000) ...
Adding new user `xusongqin' (1000) with group `xusongqin' ...
Creating home directory `/home/xusongqin' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for xusongqin
Enter the new value, or press ENTER for the default
Full Name []: [b]xusongqin[/b]
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] [b]Y[/b]
root@AY130925102139735305Z:/home# [b]ls[/b]
xusongqin
[b]为该用户增加sudo权限:[/b]
root@AY130925102139735305Z:[b]vi /etc/sudoers [/b]
##为用户添加sudo权限 xusongqin ALL=(ALL:ALL) ALL
# User privilege specification
root ALL=(ALL:ALL) ALL
[b]xusongqin ALL=(ALL:ALL) ALL[/b]
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives: