Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

cat /etc/passwd |grep postgre

postgres:x:115:127:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash

apt-cache show postgresql

Package: postgresql
Priority: optional
Section: database
Installed-Size: 65
Maintainer: Ubuntu Developers <>
Original-Maintainer: Debian PostgreSQL Maintainers <>
Architecture: all
Source: postgresql-common (136)
Version: 9.1+136
Depends: postgresql-9.1
Filename: pool/main/p/postgresql-common/postgresql_9.1+136_all.deb
Size: 5468
MD5sum: 34f5a1373ad5cd0b6f5aa3e7af06c9e7
SHA1: 6f271758bd51c23614b12fd63fb711ecfa43e9e5
SHA256: e8921a22b560e81f57a2a00001e31ba1036f67a8e7f151bf8f977b4919fc559a

Can I replace that /bin/bash with /bin/false ?

share|improve this question
@Jorge Castro my question is, why is there a shell for PostgreSQL's user, not why there is there a user for PostgreSQL.. because I have seen other users such as MySQL did not required it. – Smile.Hunter Dec 27 '12 at 2:07
up vote 4 down vote accepted

There is a shell because we use PostgreSQL from the command line as the PostgreSQL user.

share|improve this answer
Then, We did not use MySQL as the MySQL user right? I guess may that user was used for internally system, This means I should not remove that /bin/bash for keep my PostgreSQL running correctly.. Thanks you anyway! – Smile.Hunter Dec 27 '12 at 2:25

Postgres runs under a special operating system user account for security reasons. This account is created on your machine when the installer runs, and unless overridden on the command line, it will be called "postgres".

On Unix-like operating systems such as Linux and Mac OS X, the account is setup without a password and users generally never need to worry about it again. Source.

Also it's not a good practice to edit the passwd file manually. You should use the command:

sudo passwd postgres
share|improve this answer
Thanks but I want to know why there is a "bash shell" for a user for PostgreSQL, I have learned that permission cause someone logged in to postgresql and then somehow got a bash shell which is not make sense for a service user that I would never logged in to. (I see other user for another services like apache2,mysql, they did not required bash shell for their users) – Smile.Hunter Dec 27 '12 at 2:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.