사용자 및 그룹 관리: `useradd`, `usermod`, `groupadd`
리눅스 시스템에서 사용자 계정과 그룹을 만들고 수정하고 삭제하는 방법을 배웁니다.
사용자 및 그룹 관리: `useradd`, `usermod`, `groupadd`은(는) CoddyKit의 무료 Linux Command Line Mastery 강의입니다. 이것은 4개 중 1번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Linux Command Line Mastery 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Linux Command Line Mastery 강의에는 총 4개의 강의가 포함되어 있습니다.
이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.
Welcome to User Management
In Linux, managing users and groups is crucial for security and organization. Every file and process has an owner, and permissions are often set based on user and group affiliations.
This lesson will teach you how to create, modify, and remove user accounts and groups.
Creating New Users: `useradd`
The useradd command creates a new user account. By default, it creates a new primary group with the same name as the user and assigns a unique User ID (UID).
You'll often need sudo (superuser do) privileges to run this command.
sudo useradd newuserCustomizing Users: Home & Shell
When you create a user, you might want to specify their home directory and default shell. The -m option creates the user's home directory if it doesn't exist, and -s sets their login shell.
Without -m, no home directory is created, which can cause issues.
sudo useradd -m -s /bin/bash devuserVerifying User Details: `id`
After creating a user, you can verify their existence and check their User ID (UID) and Group IDs (GIDs) using the id command. This helps confirm the account was set up correctly.
id devuserUnderstanding Linux Groups
Groups are collections of users. They simplify permission management, allowing multiple users to share access to files and resources without individually setting permissions for each user.
Each user has a primary group (often named after the user) and can belong to multiple supplementary groups.
Creating New Groups: `groupadd`
To create a new group, you use the groupadd command. This is useful for organizing users into functional teams, like 'developers' or 'admins', and then assigning file permissions to that group.
sudo groupadd project_teamAdding Users to Groups: `usermod`
The usermod command modifies an existing user account. To add a user to a supplementary group, use the -aG (append to Group) option.
Remember, -a must be used with -G to append, otherwise -G alone would overwrite existing supplementary groups!
sudo usermod -aG project_team devuserModifying User Accounts: `usermod`
Beyond adding to groups, usermod can change various user properties. For example, you can change a user's primary group using -g or update their full name/comment using -c.
Always be careful when modifying user accounts, especially sensitive information.
sudo usermod -c "Developer for Project X" devuserRemoving Users and Groups
To remove a user account, use userdel. The -r option is commonly used to remove the user's home directory and mail spool along with the account.
To remove a group, use groupdel. A group cannot be removed if it's the primary group for any existing user.
sudo userdel -r olduser
sudo groupdel oldgroupQuick Check: User & Group Commands
Which of the following commands would you use to add an existing user named analyst1 to a new supplementary group named data_team?
Recap: User & Group Management
Congratulations! You've learned the essentials of user and group management in Linux.
useraddcreates new user accounts.groupaddcreates new groups.usermodmodifies existing user accounts and can add users to supplementary groups using-aG.userdelandgroupdelremove users and groups, respectively.
These commands are fundamental for system administration and maintaining a secure Linux environment.
자주 묻는 질문
“사용자 및 그룹 관리: `useradd`, `usermod`, `groupadd`” 강의는 무료인가요?
네 — “사용자 및 그룹 관리: `useradd`, `usermod`, `groupadd`” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Linux Command Line Mastery 강의 전체를 잠금 해제할 수 있습니다. Linux Command Line Mastery 강의에는 총 4개의 강의가 포함되어 있습니다.
“사용자 및 그룹 관리: `useradd`, `usermod`, `groupadd`”에서 뭘 배우나요?
리눅스 시스템에서 사용자 계정과 그룹을 만들고 수정하고 삭제하는 방법을 배웁니다. 브라우저에서 직접 실행하는 실습 코드로 Linux Command Line Mastery을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
Linux Command Line Mastery을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 Linux Command Line Mastery은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 1번째 강의입니다.
“사용자 및 그룹 관리: `useradd`, `usermod`, `groupadd`” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 Linux Command Line Mastery 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 Linux Command Line Mastery 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.
이 강의의 모든 강의
- 사용자 및 그룹 관리: `useradd`, `usermod`, `groupadd`
- 네트워크 명령 입문: `ping`, `ip`, `netstat`
- 안전한 원격 접속: `ssh`와 `scp`
- chmod와 chown을 활용한 파일 권한과 소유권