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.3 Managing User Account in the System
In the Raspberry Pi system, user groups are maintained in "/etc/passwd" file. Internally managed data has the following format.
<User Name>: x:<UserID>: <GroupID>:<User Type>:<Home Directory>:<default bash>
■ User Name
■ User ID
■ GroupID
■ User Type
■ Home Directory
■ Default bash
When a specific user account is defined in the system, a User Id number is internally assigned to each user account. In the system internally, this User Id is always used when referring to user accounts.
Next, the following is to create the user accounts "guser001" and "guser002", and then check the contents of the "/etc/passwd" file. You can see that each user account is numbered after it.
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 |
For example, if you look at the user account "guser001", you can see that an Id of "1001" is given. The number "1001" is the internally managed User ID for this account.