Switched to postgres user after PostgreSQL install, can't switch back to normal user
Sophia Terry
I installed PostgreSQL using this guide:
It says that the install command created a Linux user postgres automatically.
So I used
sudo -i -u postgresto switch to postgres user
It went well and I could then use
psqlcommand to be able to use SQL queries.
Now I want to go back to my normal user, but I can't.
I tried
sudo -i -u usernamebut it asks for postgres password. I have no idea what it is since I didn't set it. I simply used
sudo apt install postgresql postgresql-contribcommand to install PostgreSQL and it created the postgres user and set its password for me.
Why does it ask for postgres password and not for username password? How can I switch back to my normal user?
1 Answer
Use the command exit (two times) worked for me to get back to normal user. See following