# Appendix F - Resetting Root Password or MFA

The reset method depends on whether you have SSH access to the N2W instance and what is your version of N2W:

* If you have SSH access to the N2W instance *and* are running version 4.2 and above, see section [F.1](#f.1-resetting-root-password-if-ssh-and-version-4.2-or-later).
* If you do not have SSH access to the instance *or* are running an older version, see section [F.2](#f.2-resetting-root-password-if-no-ssh-and-version-4.1-or-earlier).

## F.1 Resetting Root Password if SSH and Version 4.2 or Later

**N2W Login Reset Utility `n2ws-reset-login`:**

```
usage: n2ws-reset-login.pyc [-h] [-u USER] [-a] [-p] [-m] [-y]
Reset login credentials and/or MFA for specific/all users. 
optional arguments:
  -h, --help            show this help message and exit
  -u USER, --user USER  apply for specific user (name)
  -a, --all             apply for all users
  -p, --password        password to set
  -m, --mfa             disable MFA
  -y, --yes             auto confirm
```

**To reset login credentials and/or MFA for specific or all users:**

1. Connect to N2W instance via SSH with user '`cpmuser`' and your SSH key.
2. Switch to root: ‘`sudo su`’.
3. To see options for using the utility to reset the password or MFA, type  ‘`n2ws-reset-login`’.

<figure><img src="https://content.gitbook.com/content/5oB64hgFIX2jdQ2O72cF/blobs/a41hqJWpAsUfFGo7vnIT/n2ws-reset-login-fixed.png" alt=""><figcaption></figcaption></figure>

&#x20; 4\.  Disable the root user MFA without changing the password:

```
n2ws-reset-login -u <root_user_name> -m -y
```

<figure><img src="https://content.gitbook.com/content/5oB64hgFIX2jdQ2O72cF/blobs/dfKcexMdxBmKjPtz3CBZ/n2ws-reset-login_disableMFA_forAdminUser-paint.png" alt=""><figcaption></figcaption></figure>

&#x20; 5\.  Disable the root user MFA and reset the password:

```
n2ws-reset-login -u <root_user_name> -m -y -p
```

<figure><img src="https://content.gitbook.com/content/5oB64hgFIX2jdQ2O72cF/blobs/bmNxqK8xyatNhsCMxat0/n2ws-reset-login_disableMFA_forAdminUser_and_passwordReset-paint.png" alt=""><figcaption></figcaption></figure>

&#x20; 6\.  Enter password and confirmation entry.

&#x20; 7\.  Reset MFA if relevant.

## F.2 Resetting Root Password if no SSH and Version 4.1 or Earlier

If you don’t have SSH access, perhaps because the key is lost, or if you just need to recover your password and disable the MFA, redeploy the instance as follows:

**If you know the root/admin username:**

{% hint style="danger" %}
Make sure there are no backups or DR in progress.
{% endhint %}

1. Follow the upgrade procedure in the *N2W User Guide* at <https://docs.n2ws.com/user-guide/#1-4-upgrading-n-2-ws>.
2. When configuring the new instance, use the old username of the root/admin (important!) and the new password.
3. After the new CPM is launched, apply any necessary patches to make sure it’s up-to-date with the latest fixes and features: <https://support.n2ws.com/portal/en/kb/articles/release-notes-for-the-latest-v4-1-x-cpm-release>

**If you don’t know the root/admin username:**

{% hint style="danger" %}
Make sure there are no backups or DR in progress.
{% endhint %}

1. Follow the upgrade procedure in the *N2W User Guide* at <https://docs.n2ws.com/user-guide/#1-4-upgrading-n-2-ws>.
2. During the “upgrade” process, type the username you think it is and the new password.
3. If you typed the wrong root username, N2W will assume you forgot it and will create a file on the server, '`/tmp/username_reminder'`, containing the old username.
   1. To view this file, connect to the N2W  server using SSH as ‘`cpmuser`’.
   2. Now you will be able to use the older username with the new password.
4. After the new CPM is launched, apply any necessary patches to make sure it’s up-to-date with the latest fixes and features: <https://support.n2ws.com/portal/en/kb/articles/release-notes-for-the-latest-v4-1-x-cpm-release>

For further information, see <https://support.n2ws.com/portal/en/kb/articles/how-to-reset-the-password-for-the-root-admin-cpm-user>
