To access the rails console, ssh into your server. To do that, open a terminal on your computer and run:
ssh root@<your_forum_ip_address>
Replace <your_forum_ip_address> with the IP address of your Discourse site.
If that command is successful, you will see a prompt that looks something like this. Your IP address, or droplet name will be displayed instead of the word testeleven:
root@testeleven:~#
Type cd /var/discourse and hit your enter key.
Now type ./launcher enter app and hit the enter key.
You should see a prompt that ends with something similar to this: /var/www/discourse#
At that prompt, type rails c and hit your enter key. You should now see a prompt that looks similar to this: pry(main)> . This is the rails console.
To disable forced second factor authentication, type SiteSetting.enforce_second_factor="no" and hit your enter key.
To exit the SSH session, you will need to enter the word exit into the terminal three times. The first time is to exit the rails console, the second time is to exit the docker container, the third time is to exit the SSH session.