Use Cases


Torrent Suite Software space on Ion Community

Use Cases TOC

Change Your Torrent Browser Password

It is possible for a user to change the UI password and lock themselves out of the Torrent Browser Admin screen, or locked out of the Torrent Browser UI altogether.

The UI password is stored in a database field. When you access to the database, you can change the password.

Method one

The first way to change a username with minimal terminal interaction is to create a new super user account.

  1. Run the following commands:

                   cd /opt/ion/iondb
    ./manage.py createsuperuser
                  
  2. Once the new superuser account has been created, login to the admin page with the newly created username and password.



  3. Select the user section under Auth:







    Icon
    The Auth section does not appear if you login with an ionuser account.
  4. Select the account you want to change the password for:

  5. Click Change password form :







  6. Enter the new desired password and click Change Password :

Method two

WARNING

Icon

This process updates the database directly, and has no undo or recover in case of error. Do not proceed with this process if you are not comfortable with SQL commands.

Step 1: Login to the database

Log into your Torrent Server host and get an interactive postgres database command prompt:

             ionadmin@my-torrent-server:~$ psql -U ion -d iondb
psql (8.4.5)
Type "help" for help.

iondb=>
            
Step 2: Display the user list

In our example, the user ionadmin forgot the password, but we know the ionuser password.

This command provides a list of users and passwords:

             iondb=> SELECT username, password from auth_user; username | password
----------+-----------------------------------------------------
 ionuser  | sha1$7e254$476582a5fa365cdd6081a80ac161c1904cc9c374
 ionadmin | sha1$93099$b7da0df453d8db1c7715cabef9651c73003de849
 ion      | sha1$7798b$c025c463682f84b66cf3b5168356a04e3ce3b899
(3 rows)
            
Step 3: Copy the password from another user

The passwords are hashed in the database, so we do not know what the actual password is. But we know the ionuser password is ionuser, so we can copy that hashed password to ionadmin , and that will change the ionadmin password to ionuser .

WARNING

Icon

The UPDATE command modifies the database. Do not proceed with this step if you are not comfortable with SQL commands.

             iondb=> UPDATE auth_user
  set password='sha1$7e254$476582a5fa365cdd6081a80ac161c1904cc9c374'
  where username='ionadmin';
            
Step 4: Check that the password has been changed

Query the database one again to verify that the password has been changed. See that ionadmin and ionuser now have the same password

             iondb=> SELECT username, password from auth_user; username | password
----------+-----------------------------------------------------
 ionuser  | sha1$7e254$476582a5fa365cdd6081a80ac161c1904cc9c374
 ionadmin | sha1$7e254$476582a5fa365cdd6081a80ac161c1904cc9c374
 ion      | sha1$7798b$c025c463682f84b66cf3b5168356a04e3ce3b899
(3 rows)
            
Step 5: Reset the password

Now you can log in via the UI as ionadmin , and reset the password. Remember to change the password via the Change password form.