How to Manage Users & Permissions

Introduction

Managing users and permissions is crucial for maintaining security and control over your server or hosting environment. Whether you are using a control panel like cPanel, Plesk, or DirectAdmin, or managing a Linux server via SSH, understanding how to create users and assign appropriate permissions ensures that only authorized individuals can access and modify critical files. This guide will walk you through the process of managing users and permissions effectively.

Step 1: Understanding User Roles and Permissions

Types of Users

  • Administrator (Root/Superuser): Has full control over the server and all files.

  • Reseller: In control of managing multiple hosting accounts (common in shared hosting environments).

  • Regular Users: Can manage their websites and email accounts but have limited access to server settings.

  • FTP Users: Only have access to upload/download files.

Permission Levels

  • Read (r): Allows viewing file contents.

  • Write (w): Allows modifying or deleting files.

  • Execute (x): Allows running scripts or applications.

  • Owner, Group, Others: Determines who can access files (owner, specific user groups, or the public).

Step 2: Managing Users & Permissions in cPanel

  1. Log into cPanel

    • Access cPanel via https://yourdomain.com/cpanel.

  2. Create New Users

    • Navigate to User Manager under the Preferences section.

    • Click Add User, enter details (username, email, password), and set privileges.

  3. Assign File Permissions

    • Use the File Manager in cPanel.

    • Right-click a file or folder and select Change Permissions to modify access levels.

  4. Manage FTP Accounts

    • Go to FTP Accounts to create and manage access for different users.

Step 3: Managing Users & Permissions in Plesk

  1. Log into Plesk

    • Access Plesk via https://yourdomain.com:8443.

  2. Create User Accounts

    • Navigate to Users > Add User.

    • Assign roles such as Administrator, Web User, or FTP User.

  3. Set Permissions

    • In File Manager, select a file or directory and modify access settings.

  4. Manage FTP & Database Users

    • Under Websites & Domains, you can create database and FTP users with restricted access.

Step 4: Managing Users & Permissions in DirectAdmin

  1. Log into DirectAdmin

    • Access DirectAdmin via https://yourdomain.com:2222.

  2. Add Users

    • Go to Account Manager > User Accounts.

    • Click Create User and assign necessary privileges.

  3. Modify File Permissions

    • Use the File Manager to adjust file and folder permissions.

Step 5: Managing Users & Permissions via SSH (Linux Server)

If you're using a VPS or dedicated server without a control panel, you can manage users via SSH.

Creating Users

sudo adduser newusername

BashCopy

Assigning User Permissions

  • Change file ownership:

sudo chown username:groupname /path/to/file

BashCopy

  • Modify permissions:

sudo chmod 755 /path/to/file

BashCopy

Granting Sudo Privileges

To give a user administrative privileges, add them to the sudo group:

sudo usermod -aG sudo newusername

BashCopy

Managing User Access

  • List users:

cat /etc/passwd

BashCopy

  • Delete a user:

sudo deluser username

BashCopy

Best Practices for User Management

  • Use the principle of least privilege (PoLP): Grant only necessary permissions.

  • Regularly review user access: Remove or restrict inactive users.

  • Use strong passwords and SSH keys: Enhance security by enforcing strong authentication methods.

  • Monitor user activity: Check logs for unauthorized access attempts.

Conclusion

Proper user and permission management is essential for maintaining security and efficiency in your hosting environment. Whether using cPanel, Plesk, DirectAdmin, or a Linux server, ensuring the right users have the correct level of access helps protect your data and server integrity.

Last updated

Was this helpful?