Unix如何添加新的用户
要在UNIX系统中增加新用户,可采用useradd命令,常用命令格式如下:
/etc/useradd [-c comment] [-d directory]] [-g group] [-m] [-s shell] username
其中,
-c comment 表示注释
-d directory 表示家目录
-g group 表示属于哪个用户组
-m 表示若家目录不存在,则自动创建
-s shell 表示该用户使用的shell
username 用户名
例1:要创建一个名为devos的用户,其它默认,创建命令如下:
useradd -m devos
若directory不出现,则自动创建缺省家目录,如/usr/ devos,缺省shell为B Shell。
例2:要创建一个名为ncp的用户,shell为ksh,其它默认,创建命令如下:
useradd -m -s /bin/ksh ncp
例3:下面的命令:
useradd -c “Test User” -m -d /test/test02 -g omc -s /bin/ksh test02
表示要创建一个名为test02的用户,属于omc用户组,家目录为/test/test02(自动创建)。“Test User”表示注释。
设密码
对用户devos建立密码的命令为:
passwd devos
/etc/useradd [-c comment] [-d directory]] [-g group] [-m] [-s shell] username
其中,
-c comment 表示注释
-d directory 表示家目录
-g group 表示属于哪个用户组
-m 表示若家目录不存在,则自动创建
-s shell 表示该用户使用的shell
username 用户名
例1:要创建一个名为devos的用户,其它默认,创建命令如下:
useradd -m devos
若directory不出现,则自动创建缺省家目录,如/usr/ devos,缺省shell为B Shell。
例2:要创建一个名为ncp的用户,shell为ksh,其它默认,创建命令如下:
useradd -m -s /bin/ksh ncp
例3:下面的命令:
useradd -c “Test User” -m -d /test/test02 -g omc -s /bin/ksh test02
表示要创建一个名为test02的用户,属于omc用户组,家目录为/test/test02(自动创建)。“Test User”表示注释。
设密码
对用户devos建立密码的命令为:
passwd devos
【Unix如何添加新的用户】相关文章
1. Unix如何添加新的用户
3. Oracle查看当前用户的角色和查看当前用户的系统权限和表级权限
5. 如何为DataGridView添加一个定制的Column Type
10. Linux如何压缩可执行文件
本文来源:https://www.mianshiwenti.com/a13662.html
进入下载页面
上一篇:与UNIX有关的几个名词
下一篇:Unix如何在一行中运行多个命令
﹝Unix如何添加新的用户﹞相关内容
- 如何改选新的工会主席?
- 如何启动时不需输入用户名与密码
- PHP如何对用户密码进行加密
- C#如何进行LDAP用户校验
- C#如何判断当前用户是否输入某个域
- Hashtable 添加内容的方式有哪几种,有什么区别?
- Math.round(11.5)等於多少? Math.round(-11.5)等於多少?
- 软件测试LoadRunner面试题:Explain the following functions: – lr_debug_message
- 软件测试LoadRunner面试题:What is a function to capture dynamic values in the web vuser script?
- 为什么UNION ALL比UNION快