Publicidad

loading...

sábado, 20 de diciembre de 2014

Change User Password 'postgres' in Ubuntu

Change User Password 'postgres' in Ubuntu

  
Whenever we install postgresql in Ubuntu is assigned a random user 'postgres' password and this must be changed manually post-installation. This is not a bug in the installer, it is a default security behavior installer. Cambiano password To change the password in a default installation or because they simply forgot the password and there are no more users the following is done in a terminal: 1) impersonating the user 'postgres'. $ Sudo su postgres 2) Run the utility $ psql psql currently are connecting to the database using the user 'postgres' with this user can change passwords of many users even the same 'postgres'. Now let's change the password, run on the command line present the following sequence where 'passwd' is the new password (single quotes must be used): alter user postgres with password 'passwd'; If the response program with the message 'ALTER ROLE' the password has been changed successfully. To exit the utility can type: \ q to exit the user 'postgres' type the following: exit Done. The password has been changed successfully. Testing the Connection To test the connection you can use the same utility 'psql' as follows: psql -U postgres -W Press ENTER and enter the new password (once You should have changed it in the example above, if you did not password it is 'passwd').