Sharing

2011年10月27日 星期四

Ubuntu 上增加新使用者


pjack@ubuntu64-33-7:~$ sudo adduser wistor
[sudo] password for pjack:
Adding user `wistor' ...
Adding new group `wistor' (1001) ...
Adding new user `wistor' (1001) with group `wistor' ...
Creating home directory `/home/wistor' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for wistor
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
pjack@ubuntu64-33-7:~$ sudo adduser wistor admin
Adding user `wistor' to group `admin' ...
Adding user wistor to group admin
Done.



如果在執行 sudo 時不想需要密碼,要在 /etc/sudoers.d 內新增檔案, 內容加上 NOPASSWD

root@ubuntu1104-64-5:/etc/sudoers.d$ ls
pjack  README  www-data
root@ubuntu1104-64-5:/etc/sudoers.d$ cat pjack
pjack   ALL=(ALL:ALL) NOPASSWD: ALL

沒有留言: