增加新用户,使用adduser命令:
root@AY130925102139735305Z:/home#sudoadduserxusongqin
Addinguser`xusongqin'...
Addingnewgroup`xusongqin'(1000)...
Addingnewuser`xusongqin'(1000)withgroup`xusongqin'...
Creatinghomedirectory`/home/xusongqin'...
Copyingfilesfrom`/etc/skel'...
EnternewUNIXpassword:
RetypenewUNIXpassword:
passwd:passwordupdatedsuccessfully
Changingtheuserinformationforxusongqin
Enterthenewvalue,orpressENTERforthedefault
FullName[]:xusongqin
RoomNumber[]:
WorkPhone[]:
HomePhone[]:
Other[]:
Istheinformationcorrect?[Y/n]Y
root@AY130925102139735305Z:/home#ls
xusongqin
为该用户增加sudo权限:
root@AY130925102139735305Z:vi/etc/sudoers
##为用户添加sudo权限xusongqinALL=(ALL:ALL)ALL
#Userprivilegespecification
rootALL=(ALL:ALL)ALL
xusongqinALL=(ALL:ALL)ALL
#Membersoftheadmingroupmaygainrootprivileges
%adminALL=(ALL)ALL
#Allowmembersofgroupsudotoexecuteanycommand
%sudoALL=(ALL:ALL)ALL
#Seesudoers(5)formoreinformationon"#include"directives: