- Linux:Powerful Server Administration
- Uday R. Sawant Oliver Pelz Jonathan Hobson William Leemans
- 209字
- 2021-07-09 18:16:43
Adding group members
Once you have groups in place, you can add existing users as well as new users to that group. All access rights and permissions assigned to the group will be automatically available to all the members of the group.
Getting ready
You will need super user or root privileges to add a group member to the Ubuntu server.
How to do it…
Follow these steps to add group members:
- Here, you can use
adduser
command with two non-option arguments:$ sudo adduser john guest
- Enter your password to complete
addgroup
with root privileges.
How it works…
As mentioned previously, you can use the adduser
command to add an existing user to an existing group. Here, we have passed two non-option arguments:
john
: This is the name of the user to be added to the groupguest
: This is the name of the group
There's more…
Alternatively, you can use the command usermod
to modify the group assigned to the user:
$ sudo usermod -g <group> <username>
To add a user to multiple groups, use the following command:
$ sudo usermod -a -G <group1>,<group2>,<group3> <username>
This will add <username>
to <group1>
, <group2>
, and <group3>
. Without flag –a
, any previously assigned groups will be replaced with new groups.
- 大數(shù)據(jù)導(dǎo)論:思維、技術(shù)與應(yīng)用
- 基于C語言的程序設(shè)計
- Getting Started with Containerization
- 機艙監(jiān)測與主機遙控
- STM32G4入門與電機控制實戰(zhàn):基于X-CUBE-MCSDK的無刷直流電機與永磁同步電機控制實現(xiàn)
- 大數(shù)據(jù)安全與隱私保護(hù)
- Blender Compositing and Post Processing
- 智能制造系統(tǒng)及關(guān)鍵使能技術(shù)
- 常用傳感器技術(shù)及應(yīng)用(第2版)
- Linux常用命令簡明手冊
- 機器人剛?cè)狁詈蟿恿W(xué)
- 軟測之魂
- 百度智能小程序:AI賦能新機遇
- 細(xì)節(jié)決定交互設(shè)計的成敗
- Deep Learning with PyTorch Quick Start Guide