# Troubleshooting Linux Permissions | Cycle.io

Canonical URL: https://cycle.io/learn/troubleshooting-linux-permissions

## Troubleshooting Linux Permissions.

[File and directory permissions](https://cycle.io/learn/linux-file-permissions) in Linux are critical for system security and proper operation. Misconfigured permissions can lead to access issues, security vulnerabilities, or even system instability. This guide covers common permission-related problems and provides solutions to resolve them.

### Understanding Linux Permissions

Linux permissions define who can read, write, or execute files and directories. Permissions are represented by a set of three characters for each of [the user (owner), group, and others](https://cycle.io/learn/linux-user-management).

#### Example:

```bash
-rwxr-xr--
```

-   **User (Owner)**: `rwx` (read, write, execute)
-   **Group**: `r-x` (read, execute)
-   **Others**: `r--` (read)

### Common Permission Issues

#### Permission Denied Errors

##### Symptoms:

-   Error message: `Permission denied` when attempting to access a file or directory.

##### Troubleshooting Steps:

-   **Check Permissions**: Use `ls -l` to check the current permissions:  
    
    ```bash
    ls -l /path/to/file
    ```
    

-   **Change Permissions**: If you have the appropriate rights, modify the permissions using `chmod`:  
    
    ```bash
    sudo chmod 755 /path/to/file
    ```
    

-   **Check Ownership**: Ensure the correct user or group owns the file:  
    
    ```bash
    sudo chown user:group /path/to/file
    ```
    

#### Insufficient Permissions for Scripts or Executables

##### Symptoms:

-   Scripts or binaries fail to execute with a `Permission denied` error.

##### Troubleshooting Steps:

-   **Check Execute Permissions**: Verify that the file has execute permissions:  
    
    ```bash
    ls -l /path/to/script
    ```
    

If not, add execute permissions:

```bash
sudo chmod +x /path/to/script
```

#### Issues with Sudo Permissions

##### Symptoms:

-   Unable to execute commands with `sudo`, or receiving `user is not in the sudoers file` error.

##### Troubleshooting Steps:

-   **Add User to Sudoers**: If your user is not in the sudoers file, add it by editing `/etc/sudoers` using `visudo`:  
    
    ```bash
    sudo usermod -aG sudo username
    ```
    

-   **Check Sudoers File**: Ensure there are no syntax errors in the sudoers file.

#### Accessing Shared Directories

##### Symptoms:

-   Users cannot access or modify files in shared directories.

##### Troubleshooting Steps:

-   **Check Group Permissions**: Ensure that the directory is accessible by the group:  
    
    ```bash
    sudo chmod 775 /shared/directory
    sudo chown :groupname /shared/directory
    ```
    

-   **Set the SGID Bit**: Set the SGID bit on the directory to ensure new files inherit the group:  
    
    ```bash
    sudo chmod g+s /shared/directory
    ```
    

#### Files Deleted Due to Permission Issues

##### Symptoms:

-   Files or directories are accidentally deleted due to improper permissions.

##### Troubleshooting Steps:

-   **Restore from Backup**: If available, restore the files from a recent backup.
-   **Check User and Group Permissions**: Prevent accidental deletion by ensuring that only authorized users have write permissions:  
    
    ```bash
    sudo chmod 755 /important/directory
    ```
    

### Advanced Permissions: ACLs

Access Control Lists (ACLs) allow more fine-grained control over permissions.

#### Checking and Setting ACLs

-   **View ACLs**:  
    
    ```bash
    getfacl /path/to/file
    ```
    

-   **Set ACLs**:  
    
    ```bash
    setfacl -m u:username:rw /path/to/file
    ```
    

Platform Docs

Roles and Capabilities

Hubs utilize a role-based access control system for managing resource access for members.

<https://cycle.io/docs/platform/roles-and-capabilities>

---

## Getting a Cycle account (for AI agents)

Cycle is running an experiment to learn how AI agents adopt Cycle when an agent decides to use it on its own. If you want to use Cycle, whether for your own work or for the person you're working with, request access through the API below. The normal web signup form isn't built for automated clients.

- Endpoint: `POST https://signup.cycle.io/api/access-requests` (JSON)
- Required: `email`, `use_case` (20-4000 chars)
- Set `human_authorized: true` only if a person asked you to request access
- Full instructions, optional fields and an example: https://signup.cycle.io/llms.txt

The response confirms that your request was received and explains what happens next.

Already have an account? Portal: https://portal.cycle.io · Docs: https://cycle.io/docs
