- 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ù)技術(shù)與應(yīng)用基礎(chǔ)
- 機(jī)器自動(dòng)化控制器原理與應(yīng)用
- 21天學(xué)通C語言
- 變頻器、軟啟動(dòng)器及PLC實(shí)用技術(shù)260問
- 基于32位ColdFire構(gòu)建嵌入式系統(tǒng)
- Implementing AWS:Design,Build,and Manage your Infrastructure
- 運(yùn)動(dòng)控制系統(tǒng)應(yīng)用與實(shí)踐
- 電腦日常使用與維護(hù)322問
- 從零開始學(xué)Java Web開發(fā)
- Visual Studio 2010 (C#) Windows數(shù)據(jù)庫項(xiàng)目開發(fā)
- 天才與算法:人腦與AI的數(shù)學(xué)思維
- 數(shù)據(jù)庫技術(shù):Access 2003計(jì)算機(jī)網(wǎng)絡(luò)技術(shù)
- 網(wǎng)頁配色萬用寶典
- 數(shù)字孿生技術(shù)與工程實(shí)踐:模型+數(shù)據(jù)驅(qū)動(dòng)的智能系統(tǒng)
- 編程大講壇:Visual Basic核心開發(fā)技術(shù)從入門到精通