RPort
Search…
Recover lost passwords
Learn how to get access to the RPort server if you have lost all password
This guide only applies to the self-hosted version of RPort. SaaS customer must use the portal to reset the admin password of there server instance.

Step 1 – log in via SSH

To reset a lost password, login to your RPort server via SSH and become the root user. If you have installed the RPort server with the cloud-installer script, a sqlite3 database is used for authentication.
If you are not sure what is the underlying storage for users and passwords, open the configuration file with a page, for example, less /etc/rport/rportd.conf and scroll down to the [api] section.
Check where users and passwords are stored

Step 2 – create a new hash

If you are using a static pair of username and password – option number 1 in the above screenshot – just change it and restart the rport server.
If users and passwords are stored in a json-file or in a database, all passwords are stored as brypt hashes. Create a new hash and store it in the variable PASSWD_HASH.
1
NEW_PASSWD="<TYPE_IN_HERE>"
2
PASSWD_HASH=$(htpasswd -nbB password $NEW_PASSWD|cut -d: -f2)
Copied!
Create a password hash

Step 3 – update the password

On a json file

If you are using a json file, open it with a text editor, go to the line of the user you want the password to be updates, and replace the password hash by the one previously created.
Restart the rport server using systemctl restart rport and you are done.

On a sqlite database

Check who is in there.
1
DB_FILE=/var/lib/rport/user-auth.db
2
cat <<EOF|sqlite3 $DB_FILE
3
.headers ON
4
SELECT * FROM users;
5
EOF
Copied!
Update the password hash of a user
1
DB_FILE=/var/lib/rport/user-auth.db
2
cat <<EOF|sqlite3 $DB_FILE
3
UPDATE users SET password="$PASSWD_HASH" WHERE username="admin";
4
EOF
Copied!
This will update the password of the user admin with the previously created hash. 💪 You are done. You don't need to restart the rport server.
Last modified 2mo ago