您的位置:首页 > 运维架构 > Linux

linux创建用户

2009-07-31 11:30 274 查看
添加用户:

[root@localhost ~]# useradd test
[root@localhost ~]# passwd test
Changing password for user test.
New UNIX password:

Retype new UNIX password:
passwd: all authentication tokens updated successfully.

此时,该用户才是可以使用的。

设置的默认规则如下:
[root@localhost ~]# useradd -D
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=no

删除用户:

[root@localhost ~]# userdel test
[root@localhost ~]# userdel -r test


注:可以用userdel 来删除test用户,我们看到第二个例子中多了一个参数-r ,第一个例子是说只删除test用户,其家目录和mail等仍会保存;加上-r 参数,是删除家目录及mail等;所以要小心操作;用userdel 删除用户的同时,也会把其用户组删除;

参考资料:

http://hi.baidu.com/vincent_1984/blog/item/42f83451c34ca5898c5430ff.html

http://blog.chinaunix.net/u1/36131/showart_382813.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: