I set my password to ir****3 when installing Ubuntu, but when I try to use su - postgres on terminal and enter tge same password it shows authentication error: you are not a root user.
How can I fix this?
I set my password to ir****3 when installing Ubuntu, but when I try to use su - postgres on terminal and enter tge same password it shows authentication error: you are not a root user.
How can I fix this?
In order to run
su - postgres
you have to be root as the output says
=> If you are not root you have to run it with sudo like
sudo su - postgres
Or alternatively become root first using
sudo -i
su - postgres
Anyway both methods will only work, if your actual user is in the sudo group. You can check that listing all groups your user is in by running
groups
If it is not in the sudo group than you probably are not the one who installed this machine or have added this user afterwards.
By default the first added user during the installation is in the sudo group.
If this is the case you have to login as a user which is in the sudo group
(or if this is not possible you can boot into a root terminal following this answer)
and add your user manually to the sudo group running
sudo adduser <username> sudo
sudoasks for your password and not root. Note:sudois a command and not a login (it raises your privileges to root for the command that follows) – guiverc Feb 14 '18 at 06:44sudo passwd(sudo will raise privileges to root then run passwd) – guiverc Feb 14 '18 at 07:06su - postgreswould require a login password for userpostgres- that's nothing to do with "login sudo on terminal" as stated in your question nor of therootaccount's login password. – steeldriver Feb 14 '18 at 07:38