# Enable SSH access for root.

##### 🚀 One-Line Download &amp; Execute :

```bash
apt update && apt install -y curl && clear && curl -s https://docs.greenhome.stream/attachments/38 | bash
```

OR

```bash
apt update && apt install -y wget && clear && wget -q https://docs.greenhome.stream/attachments/38 && bash enable_root_ssh.sh && rm -f enable_root_ssh.sh
```


#### To enable root SSH login on a Linux system, follow these steps :

1. Log in to your server with an account that has sudo or root privileges.
2. Set or confirm the root password if needed :  
    ```bash
    sudo passwd root
    ```
    
    Enter and confirm the new root password.
3. Edit the SSH daemon configuration file :  
    ```bash
    sudo nano /etc/ssh/sshd_config
    ```
4. Find the line containing PermitRootLogin. It may be commented out with a #. Change or add this line :  
    ```bash
    PermitRootLogin yes
    ```
5. Save the file and exit the editor.
6. Restart the SSH service to apply the changes :  
    ```bash
    sudo systemctl restart sshd
    ```
    
    or  
    ```bash
    sudo service sshd restart
    ```
7. You can now log in remotely as root using SSH :  
    ```bash
    ssh root@your-server-ip
    ```
    
    Enter the root password when prompted.

##### Important Security Note :

Enabling root login over SSH is a security risk. It’s recommended to use normal user accounts with sudo privileges instead. If you enable root SSH login, consider using SSH key authentication and strong passwords to improve security.

This method applies to most Linux distributions, including Ubuntu, Debian, CentOS, Rocky Linux, and others. Some systems may use slightly different service names or editors, but the main steps remain the same.

<span style="color: rgb(224, 62, 45);">**Ins0mniA**</span>

<div class="notranslate" id="bkmrk--1" style="all: initial;"></div>