Skip to content

WeOmega - Publishing

Just another WeOmega Office Sites site
  • Welcome
  • Company
    • Company Business
    • Company Profile
  • Publishing
    • Overview
  • Book Summary
    • Book List
    • Book Review
      • Book Review – All of the IOT Starting with Latest Raspberry Pi from Beginner to Advanced
      • Book Review – 최신 Raspberry Pi로 시작하는 IOT의 모든 것 – 초보에서 고급까지
      • Book Review – ERP SAP R/3 ALE, EDI & IDOC 기술
  • Book Content
    • RaspberryPi
      • RaspberryPi-English
      • RaspberryPi-Korea
    • SAP ALE/IDOC
      • SAP ALE/IDOC-English
      • SAP ALE/IDOC-Korea

Raspberry Pi_Eng_12.7.7 Assignment of User Account to User Group

Posted on July 25, 2017 by weomega


Published Book on Amazon


All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 1
All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 2


출판된 한글판 도서


최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (상)
최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (하)


Original Book Contents


12.7.7  Assignment of User Account to User Group

 

12.7.7.1    Review of Processing Method

 

If a user account is assigned to a user group, that user inherits all the responsibilities and privileges that the group has. Also, when a certain user group is given a certain responsibility and privilege, all users belonging to that user group are given the same responsibility and privilege.

 

A particular user account always belongs to the primary group, and can belong to one or more other user groups at the same time. There are many ways to assign a user account to a user group. You can specify a user group at the same time you create a user account, or you can assign a user group as a separate task after creating a user account.

 

In this case, try to use the "adduser" command to specify how to assign the user group separately.

 


 

12.7.7.2    Assigning User Group with "adduser" Command

 

[Command Format]

adduser [options] user group

 

[Command Overview]

■   This defines a new user account or assigns a user group to an existing user account.

■   User privilege          -- Super user.

 

[Detail Description]

■   None

 

[Main Option]

--group

 

When combined with --system, a group with the same name and ID as the system user is created. If not combined with --system, a group with the given name is created. This is the default action if the program is invoked as addgroup.

--system

Create a system user or group.

 

 

 

[Files]

/etc/group

Group account information.

/etc/gshadow

Secure group account information.

 

[Used Example]

You want to assign the user "guser001" to the new group "ggroup001". If you look in the "/etc/passwd" file before doing the work, you can see that the user "guser001" is created. Also, in the "/etc/group" file, the user group "guser001" is given an id of "1004" and the same id is specified in the user "guser001" in "/etc/passwd" file.

Also, when you look up the "/etc/group" file, you can see that the user group "ggroup001" is created.

 

pi@raspberrypi ~ $ sudo cat /etc/passwd

root:x:0:0:root:/root:/bin/bash

daemon:x:1:1:daemon:/usr/sbin:/bin/sh

~~~~~

guser001:x:1001:1004:General User 001,,,:/home/guser001:/bin/bash

guser002:x:1002:1005:General User 002,,,:/home/guser002:/bin/bash

 

pi@raspberrypi ~ $ sudo cat /etc/group

root:x:0:

daemon:x:1:

~~~~~

guser001:x:1004:

guser002:x:1005:

ggroup001:x:1006:

ggroup002:x:1007:

 

To assign the group "ggroup001" to the user account "guser001", perform the following operations.

 

pi@raspberrypi ~ $ sudo adduser guser001 ggroup001

 

When the operation is complete, check the data in the "/etc/group" file to see the results of the operation. It can be confirmed that the contents of the corresponding user are changed as follows.

 

pi@raspberrypi ~ $ sudo cat /etc/group

root:x:0:

daemon:x:1:

~~~~~

guser001:x:1004:

guser002:x:1005:

ggroup001:x:1006:guser001

ggroup002:x:1007:

 

 


 

 

 

RaspberryPi-Englishapache, debian, interface, iot, linux, logon user, mysql, php, raspberry pi, raspbian, sensor, super user, system default user, user, User Account, user group, working user

Post navigation

Previous
Next

Book Content

  • RaspberryPi
    • RaspberryPi-Korea
    • RaspberryPi-English
  • SAP ALE/IDOC
    • SAP ALE/IDOC-Korea
    • SAP ALE/IDOC-English

Recent Posts

  • SAP ALE/IDOC-English- Post List
  • RaspberryPi-English – Post List
  • RaspberryPi-Korea – Post List
  • SAP ALE/IDOC-Korea – Post List
  • SAP ALE IDOC EDI-Kor_10.2.2 File Transfer Protocol(FTP)
© WeOmega - Publishing 2025
Big Impresa designed by Iografica Themes.