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
删除用户:
注:可以用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
[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
相关文章推荐
- linux下创建与删除用户详细步骤 ***
- Linux 创建用户和工作组
- linux下创建ucenter用户
- Linux系统下连接Oracle数据库,创建新的数据库用户及分配权限
- Linux创建用户 adduser useradd
- linux下创建带密码的用户
- Linux下给mysql创建用户分配权限(基于改动)
- linux 创建, 删除用户
- Shell编程面试题4_批量创建Linux用户并设置密码
- Linux 创建用户和工作组
- Linux创建用户、用户组 及 删除
- linux创建用户命令
- Linux创建和配置FTP用户
- linux下创建用户
- linux - 创建用户
- linux学习笔记-批量创建用户并设置随机密码
- linux创建新用户后shell无法自动补全命令或使用基本的shell命令
- LINUX 创建多个用户的小脚本
- linux下创建用户
- linux下创建用户并为用户设置密码