I am new to both postgreSQL and Linux. I just installed it and discovered that it creates its own user postgres. This i am pretty sure about because you can even login as this user in the GUI mode in almost all linux distributions(tried for ubuntu and fedora). But you will not find a single directory relating to this user inside the home folder. cat /etc/passwd | grep /home | cut -d: -f1 try the above to see all of users and you won't have postgres there. To change password for postgres switch to root using su And use passwd postgres to change password and then login at the gui using switch user. The account is fully functional. But why there is no directory for this user inside the HOME folder? Please give a full working details of linux and postgresql in the answer. Thanks in advance!! :)
That there is a dedicated user for PostgreSQL is a security measure, so the DB processes can run with that user's (limited) priviledges instead of running as root.
Whether or not you can actually log on with that user, and what that user's home directory should be, is the decision of the package maintainer / the Linux distribution in question. Since the postgresql user should not be (ab-) used as just another user (with own desktop settings, user data etc.), I wouldn't question the wisdom of not giving it a home, but rather why he is enabled to log in in the first place.
Edit: Being ignorant of the fine print of PostgreSQL, and a bit confused by the wording of your question, I argued the general case. Ignacio pointed out that you had to actually break the system (unlock the user's password with root priviledges) to even be able to log in as postgresql user. So the answer can be phrased even simpler:
The user does not have a directory in /home
because you are not supposed to ever log in as that user. It's for running the database processes without root priviledges, nothing else.
(Note that you could, using the same technique, log in as user man
, or user lp
, or user mail
. You could, but it wouldn't make sense, and unlocking those user's passwords actually weakens the security of your system.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With