How to add a user to a group
来源:互联网 发布:火影忍者衣服淘宝网 编辑:程序博客网 时间:2024/06/05 07:59
This small how-to is to show you how to add users to existing groups, either new or existing users may be added to one or more groups at once.
In all examples I will use:
user: go2linux groups: admin,printers
There are two possible scenarios
1. The user is new
In this scenario we have to use useradd, and also have two different scenarios.
1.1 Adding user to supplementary group
useradd -G admin go2linux
To add the user to more than one group
useradd -G admin,printers go2linux
1.2 Adding user to primary group
useradd -g admin go2linux
2. The user already exists
In this scenario we have to use usermod
2.1 Add the user to supplementary groups
usermod -a -G admin go2linux
2.2 Add the user to a primary group, in fact change the primary group of that user
usermod -g admin go2linux
- How to add a user to a group
- How to add a new user in linux and add it to a new group
- How can I add a user to a group under Linux operating system?
- How to add a user to the sudoers list
- [Linux]---Add a new user to sudo group
- Add a User to a Group (or Second Group) on Linux
- add user to group
- How to add a button to PreferenceScreen
- How To: Check if a user is part of a SharePoint group in InfoPath
- How to add a user and set environments for the user?
- Linux Add User To Group
- How to create a user in PostgreSQL
- How to create a remote desktop user
- How to be a Google Power User
- How To Add a TwoFields Validator
- How to add a .dll file ?
- How to add a Linux service
- HP-UX ServiceGuard - Logical Volume Manager How to Add a Disk-Volume Group-Logical Volume...
- 黑马程序员_c#基础知识学习笔记:常量,枚举和结构
- Android Animation学习笔记
- 数组大折腾程序报告
- BeanFactoryPostProcessor接口
- oracle中日期类型相减,并乘以一个数,保留2位小数的方法。
- How to add a user to a group
- 触摸屏驱动总结
- python写文件、读取文件、按行修改文件
- 枪打露头鸟---数组的玩法
- 17家中国初创公司的失败史
- iPhone开发之音频101(Part 2):转换和录音
- Python标准库——走马观花
- java.lang.ClassNotFoundException: org.apache.hadoop.util.PlatformName
- 启动Java程序为Linux服务