2011年2月22日 星期二

新增使用者帳號

使用 adduser

刪除帳號 userdel

userdel -r useraccount可以刪除

這個shellscript - addnewuser.sh

可以幫你新增使用者帳號之外, 還可以設定smb密碼

download here

你可以這樣使用
chmod 755 addnewuser.sh


nelsonchung@robot:~$ . addnewuser.sh test
[sudo] password for nelsonchung:
Adding user `test' ...
Adding new group `test' (1006) ...
Adding new user `test' (1006) with group `test' ...
Creating home directory `/home/test' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for test
Enter the new value, or press ENTER for the default
Full Name []: test
Room Number []: test
Work Phone []: test
Home Phone []: test
Other []: test
Is the information correct? [Y/n] y
New SMB password:
Retype new SMB password:
Added user test.


Reference:
http://linux.vbird.org/linux_basic/0410accountmanager.php#userdel
http://www.twbsd.org/cht/book/ch24.htm

透過Facebook分享

沒有留言: