linux命令详解-useradd,groupadd
我们在linux命令行中输入useradd:
Options: -b, --base-dir BASE_DIR base directory for the home directory of the new account -c, --comment COMMENT GECOS field of the new account -d, --home-dir HOME_DIR home directory of the new account -D, --defaults print or change default useradd configuration -e, --expiredate EXPIRE_DATE expiration date of the new account -f, --inactive INACTIVE password inactivity period of the new account -g, --gid GROUP name or ID of the primary group of the new account -G, --groups GROUPS list of supplementary groups of the new account -h, --help display this help message and exit -k, --skel SKEL_DIR use this alternative skeleton directory -K, --key KEY=VALUE override /etc/login.defs defaults -l, --no-log-init do not add the user to the lastlog and faillog databases -m, --create-home create the user's home directory -M, --no-create-home do not create the user's home directory -N, --no-user-group do not create a group with the same name as the user -o, --non-unique allow to create users with duplicate (non-unique) UID -p, --password PASSWORD encrypted password of the new account -r, --system create a system account -s, --shell SHELL login shell of the new account -u, --uid UID user ID of the new account -U, --user-group create a group with the same name as the user -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
后面是其选项
groupadd [-g gid] [-o]] [-r] [-f] groupname
我们在使用linux命令时候应该清楚的是linux命令的格式,比如说上面的是我们在系统中创建一个组
我们需要用到的命令是groupadd那么后面的[-g gid][-o]是一些options我们可以进行选择,也可以不选择
比如说我们需要创建一个组,她的名字为stone我们就可以在命令行中输入:
# groupadd stone
如果我们创建一个用户组,并且在创建的时候添加一个id可以这样来进行:
# groupadd -g 999 stone1
在这个地方我们可以看到的是中括号里面的东西用或者不用都是可以的,如果我们在创建该用户组的时候,希望添加更多的信息,我们可以这样来使用,只是我们需要知道的是每一个选择项目所表示的意义
我们不需要记这些选项的含义,因为当我们想使用某一个命令的时候我们们直接将该命令输入到linux命令行中然后回车就可以将里面一些选项显示出来了
[root@VM_51_116_centos ~]# groupmod
Usage: groupmod [options] GROUP
Options:
-g, --gid GID change the group ID to GID
-h, --help display this help message and exit
-n, --new-name NEW_GROUP change the name to NEW_GROUP
-o, --non-unique allow to use a duplicate (non-unique) GID
-p, --password PASSWORD change the password to this (encrypted)
PASSWORD
比如上面我们在命令行中输入groupmod然后回车就显示出来我们所需要的选项
# groupmod -n stone2 stone1
比如我们给stone1这个组进行修改名字,我们可以这样写,这样stone1组名就变成了stone2
比如在修改之后我们再去删除组stone1
[root@VM_51_116_centos ~]# groupdel stone1
groupdel: group 'stone1' does not exist
也就是说stone1这个时候已经不存在了
我们来看看删除stone2
[root@VM_51_116_centos ~]# groupdel stone2
删除成功
下面我们来创建一个用户:useradd -u datouniao
#useradd -u 888 -o datouniao
[root@VM_51_116_centos ~]#
这个表示创建用户是成功的
下面我们做的事情是为新的用户创建密码
使用#passwd datouniao
我们为datouniao这个用户创建密码
[root@VM_51_116_centos ~]# userdel -r samll
上面是删除一个用户,同时删除这个用户的文件夹
[root@VM_51_116_centos ~]# usermod -g stone datouniao
上面的语句是将datouniao这个用户加入到组stone中
linux命令详解-useradd,groupadd相关推荐
- 《Linux命令详解手册》——Linux畅销书作家又一力作
关注IT,更要关心IT人,让系统管理员以及程序员工作得更加轻松和快乐.鉴于此, 图灵公司引进了国外知名出版社John Wiley and Sons出版的Fedora Linux Toolbox: 10 ...
- c linux time微秒_学习linux,看这篇1.5w多字的linux命令详解(6小时讲明白Linux)
用心分享,共同成长 没有什么比每天进步一点点更重要了 本篇文章主要讲解了一些linux常用命令,主要讲解模式是,命令介绍.命令参数格式.命令参数.命令常用参数示例.由于linux命令较多,我还特意选了 ...
- linux下载命令 scp,linux命令详解之scp命令
作用 scp命令常用于linux之间复制文件和目录. scp是secure copy的缩写, scp是linux系统下基于ssh登陆进行安全的远程文件拷贝命令. 格式 从本地复制到远程 复制文件 sc ...
- linux中date使用方法,linux命令详解date使用方法(计算母亲节和父亲节日期脚本示例)...
linux命令详解date使用方法(计算母亲节和父亲节日期脚本示例) 发布于 2016-02-07 15:58:40 | 108 次阅读 | 评论: 0 | 来源: 网友投递 LinuxLinux是一 ...
- RAR for Linux 命令详解
RAR for Linux 命令详解 用法: rar <命令>-<开关 1> -<开关 N> <压缩文件> <文件...> <@列表 ...
- Linux命令详解之 ls
linux 命令详解 本文主要内容来自Linux man 手册 命令名称: ls ( list files / list directory contents )列举目录内容 命令用法: ls [选项 ...
- Linux命令详解之 mv
linux 命令详解 本文主要内容来自Linux man 手册 命令名称: mv(move)移动/重命名文件 命令用法: mv [选项]... [-T] 源文件 目标文件 mv [选项]... 源文件 ...
- Linux命令详解之w命令
Linux命令详解之w命令 1.命令详解 ··· NAMEw - Show who is logged on and what they are doing. w命令就是用来展示谁在登录,以及他们在做 ...
- Linux命令详解:md5sum 命令
Linux命令详解:md5sum 命令 一.md5 算法介绍 二.md5sum 命令使用说明 三.md5sum 命令帮助 四.md5sum 命令选项.参数 语法 选项 参数 五.md5sum 命令实战 ...
最新文章
- Orleans解决并发之痛(四):Streams
- 4.MySQL基础操作
- Oracle 1204 RAC failover 测试 (一)
- Concurrenthashmap的putIfAbsent方法
- 每次编译要改名_华为突然在欧洲注册鸿蒙:正式改名方舟!与安卓竞争海外市场...
- linux ubuntu 查看历史命令
- STM32——HAL版——定时器ms和us延时函数
- 《团队-团队编程项目作业名称-最终程序》
- 微信小程序倒计时组件开发
- Protein Cell:扩增子和宏基因组数据分析实用指南
- 服务器 异常自动关机,服务器自动关机常见问题
- 不可思议有氧机器人_不思议迷宫奇怪的机器人怎么得?不思议迷宫奇怪的机器人获取一览...
- UART、SPI、I2C串行通讯协议解释 同步/异步 全双工/半双工通信含义
- 十二、构建一个基本的组合导航系统
- 腾讯免费企业邮箱服务器,如何免费申请腾讯企业邮箱?
- 中国科学院大学计算机学院夏令营,2019年中国科学院大学生数学夏令营招募通知...
- 谁有vr片源_聊一聊VR虚拟现实(八):VR视频的清晰度
- 极限中0除以常数_干货分享高数 | 极限的计算
- 直驱式永磁同步风力发电系统的仿真模型
- 宝可梦 图片识别python_使用Tensorflow从0开始搭建精灵宝可梦的检测APP