跟我学linux之帐号管理1
时间:2006-05-11 来源:wumu888
[root@server root]#vi /etc/passwd root:x:0:0:root:/root:/bin/bash |
[root@server root]#ls -l /usr/sbin/adduser lrwxrwxrwx 1 root root 7 4月 9 22:34 /usr/sbin/adduser->useradd |
[root@server root]#finger redhat #存在 Login: redhat Name:(null) Directory:/home/redhat shell:/bin/bash Nerver Logged in. No mail. No Plan. [root@server root]#finger feng #不存在 finger:feng:no such user. |
[root@server root]#useradd feng 或 [root@server root]#useradd -u 501 -d /home/feng -s /bin/bash feng |
-c 将备注信息加入/etc/passwd的备注栏中 -d 指定用户的登录主目录,这个目录不需要先行创建, -e 可设定帐号的有效期限 -f 可设定帐号过期后多少天强行关闭 -g 指定组id,这个组id必先存在/etc/group中,否则失败 -u 指定用户uid,通常是大于500,500以下由系统所使用 |
[root@server root]#usermod -c "Vice President" -d /root redhat |