# Access with Password Authentication

Before changing the password authentication switch the root user

```
sudo su 
```

<figure><img src="https://1876135298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEC5NwtFshv6EATOemuUn%2Fuploads%2FsQBPpyCz5ifZTTyXVgQz%2Fimage.png?alt=media&#x26;token=94ac6f1b-d4fe-4e37-8fdd-7274d8214de4" alt=""><figcaption></figcaption></figure>

Navigate to the **/etc/ssh/sshd\_config**

Use the vi editor to edit the file&#x20;

```
vi /etc/ssh/sshd_config
```

<figure><img src="https://1876135298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEC5NwtFshv6EATOemuUn%2Fuploads%2F8EkqKNI4GlLPLyyLgnDz%2Fimage.png?alt=media&#x26;token=3728d073-81d5-4e66-bcc3-67a07643a22c" alt=""><figcaption></figcaption></figure>

Change  PermitRootLogin prohibited\_password > PermitRootLogin yes&#x20;

PasswordAuthentication  **yes**

<figure><img src="https://1876135298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEC5NwtFshv6EATOemuUn%2Fuploads%2FvwgNxByoDvpnLKJNOBG4%2Fimage.png?alt=media&#x26;token=360cb2aa-f9c5-4c92-a1e5-8eea34e5e213" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The below step applies only to Ubuntu 22.04
{% endhint %}

Now again Navigate to the **/etc/ssh/sshd\_config.d/60-cloudimg-settings.conf**

```
vi /etc/ssh/sshd_config.d/60-cloudimg-settings.conf
```

Change PasswordAuthentication no > yes&#x20;

<figure><img src="https://1876135298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEC5NwtFshv6EATOemuUn%2Fuploads%2FHPGWkkobcM3fM0WZaUkQ%2Fimage.png?alt=media&#x26;token=996a3c25-2efe-4b46-8727-2a1113112c9e" alt=""><figcaption></figcaption></figure>

Restart the SSHd service

```
systemctl restart sshd
```

Now set the password for the root user:

```
sudo password root
```

set the password&#x20;

<figure><img src="https://1876135298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEC5NwtFshv6EATOemuUn%2Fuploads%2FCcOJhxHbN8IZMTXXI9eZ%2Fimage.png?alt=media&#x26;token=741466a0-041b-47ad-a90b-1e1bd8e0df50" alt=""><figcaption></figcaption></figure>

Now log in to the server with the root user

ssh root\@Your\_server\_IP\_add

<figure><img src="https://1876135298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEC5NwtFshv6EATOemuUn%2Fuploads%2FD6QMdd6gcAr72yJgrMmC%2Fimage.png?alt=media&#x26;token=3e51fe0d-0899-4104-9e0a-454374952be8" alt=""><figcaption></figcaption></figure>
