User Administration
%user's home directories get populated with the files from "/etc/skel/*"
1. Command:
(1)user administration
#useradd [options] username
#passwd username
#chgr groupname filename
#usermod [options] username
Options:
-L : lock the password
-U: unlock the password
-G group : append the user to the specified groups
-d home_dir : change the home directory
-e expire_date : set date which the account will expire and be disabled
#userdel [-r] username
-r : deletes the user's home directory
#chage [options] username
Options:
-m : minimum days between password changes
-M : maximum days between password changes
-E date : expier the account on this date(YYYY-MM-DD format)
-l : list the settings
(2)group administration
#groupadd groupname
#groupdel groupname
#groupmod [options] groupname
#groupmod -n newname oldname
Ex:
#groupmod -n staff employee
2. Switching Accounts
#su - [user]
#su - [user] -c command
3.Suid, Sgid, Sticky bit
#chmod u+s filename
#chmod g+s filename
#chmod g+s directory
#chmod 2770 directory
#chmod o+t /home/share
#chmod 1777 /home/share
%user's home directories get populated with the files from "/etc/skel/*"
1. Command:
(1)user administration
#useradd [options] username
#passwd username
#chgr groupname filename
#usermod [options] username
Options:
-L : lock the password
-U: unlock the password
-G group : append the user to the specified groups
-d home_dir : change the home directory
-e expire_date : set date which the account will expire and be disabled
#userdel [-r] username
-r : deletes the user's home directory
#chage [options] username
Options:
-m : minimum days between password changes
-M : maximum days between password changes
-E date : expier the account on this date(YYYY-MM-DD format)
-l : list the settings
(2)group administration
#groupadd groupname
#groupdel groupname
#groupmod [options] groupname
#groupmod -n newname oldname
Ex:
#groupmod -n staff employee
2. Switching Accounts
#su - [user]
#su - [user] -c command
3.Suid, Sgid, Sticky bit
#chmod u+s filename
#chmod g+s filename
#chmod g+s directory
#chmod 2770 directory
#chmod o+t /home/share
#chmod 1777 /home/share
全站熱搜
留言列表