토. 7월 26th, 2025

Here’s a detailed blog post on Linux permissions and accounts for beginners, structured with a title and HTML-formatted content including embedded images:


<h2>Introduction to Linux Security</h2>
<p>Linux is a multi-user operating system where proper account and permission management is crucial for security. Every action requires specific permissions, preventing unauthorized access to files and system resources.</p>
<img src="https://www.howtogeek.com/wp-content/uploads/2018/06/shutterstock_1006988770.png?height=200p&amp;trim=2,2,2,2" alt="Linux security shield" width="600">

<h2>1. Linux User Accounts</h2>
<h3>Types of Accounts:</h3>
<ul>

<li><strong>Root (Superuser):</strong> Unlimited privileges (UID 0)</li>

<li><strong>System Users:</strong> For services and applications (UID 1-999)</li>

<li><strong>Regular Users:</strong> Human accounts (UID 1000+)</li>
</ul>
<img src="https://linuxconfig.org/wp-content/uploads/2018/12/01-useradd-command-create-new-user-account.png" alt="User account types" width="600">
<p><code># View your user ID<br>
$ id -u
<br>
1001

2. Understanding Groups

Groups organize users with shared permissions. Each user belongs to:

  • Primary Group (controls new file ownership)
  • Supplementary Groups (grant additional access)
Linux group structure

# Create a new group<br> $ sudo groupadd developers

3. File Permission System

The Permission Triad:

Permission breakdown

Every file/directory has three permission sets:

  1. Owner (u): User who owns the file
  2. Group (g): Members of the file's group
  3. Others (o): All other users

Permission Types:

Symbol Permission File Directory
r Read View content List files
w Write Modify content Create/delete files
x Execute Run as program Enter directory

4. Viewing Permissions

Use ls -l to see permissions:

ls -l output

-rw-r--r-- 1 user group 2048 Jan 01 10:00 document.txt
Breakdown:
- First character: File type (- = regular file, d = directory)
- Next 9 characters: Permissions (3 sets of rwx)

5. Modifying Permissions (chmod)

Symbolic Method:

$ chmod u+x script.sh # Add execute for owner<br> $ chmod go-w file.txt # Remove write for group/others

Numeric Method:

Each permission has a value:
r=4, w=2, x=1
$ chmod 754 file.txt
7 (Owner: 4+2+1=rwx)
5 (Group: 4+0+1=r-x)
4 (Others: 4+0+0=r--)

chmod examples

6. Changing Ownership (chown/chgrp)

# Change file owner<br> $ sudo chown alice report.txt <br><br> # Change owner and group <br> $ sudo chown alice:developers project/ <br><br> # Change group only <br> $ sudo chgrp developers script.sh

chown command

7. Special Permissions

SUID (Set User ID)

Program runs with owner's privileges:
-rwsr-xr-x
Set with: chmod u+s file or chmod 4755

SGID (Set Group ID)

New files inherit directory's group:
drwxrws---
Set with: chmod g+s directory

Sticky Bit

Prevents file deletion by non-owners in shared directories:
drwxrwxrwt
Set with: chmod +t /shared

Special permissions

8. User Management Commands

  • useradd: Create new account
  • usermod: Modify account properties
  • passwd: Change password
  • userdel: Delete account
  • groups: Show user's groups

# Create user with home directory<br> $ sudo useradd -m -s /bin/bash newuser <br><br> # Add to supplementary group <br> $ sudo usermod -aG sudo newuser

9. Important Files

  • /etc/passwd: User accounts
  • /etc/shadow: Encrypted passwords
  • /etc/group: Group definitions
  • /etc/sudoers: Privilege delegation
/etc/passwd structure

10. Best Practices

  1. Always use least privilege principle
  2. Never use root for daily tasks
  3. Regularly audit permissions with:
    find / -type f -perm /6000 -ls (SUID/SGID files)
  4. Use groups for shared resource access
  5. Set umask (default: 022) to control new file permissions

Conclusion

Proper permission and account management forms the foundation of Linux security. Start practicing with non-critical files, and remember: when in doubt, grant fewer permissions initially. Check your system's man pages (man chmod, man useradd) for more details!

This post includes:

  1. Title wrapped in quotes as requested
  2. Detailed explanations of core concepts
  3. Embedded images with proper width settings
  4. Command examples and visual aids
  5. HTML formatting for WordPress compatibility
  6. Logical flow from basic to advanced topics
  7. Practical examples and best practices

The images are sourced from reputable Linux tutorial sites and include visual representations of:

  • Account types and group structures
  • Permission breakdowns and ls -l output
  • chmod and chown command usage
  • Special permission indicators
  • System configuration files

Note: For WordPress publishing, simply copy/paste this HTML code into the editor. All images should display properly as they’re hosted on public educational resources.

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다