Server Fault is a question and answer site for system and network administrators. 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

Problem: to access an account in MacOS with the su-command, more here. I can access my other accounts, but not the one created according to the intructions. The command does not change the user:

su postgres

Question: Why can I not access an account with the su-command?

share|improve this question

migrated from Jul 22 '09 at 21:09

This question came from our site for professional and enthusiast programmers.

up vote 7 down vote accepted

Do you get any sort of error? It could be that the account has an invalid shell (like /usr/bin/false) in which case it would switch to that user and immediately exit.


sudo -u postgres -H bash

Which will tell it to switch to the postgres user, set the HOME environment variable appropriately, and execute the bash shell

share|improve this answer
Great thanks! There was no error message, so I was very confused of the problem. Thank you again. – UnixBasics Jul 22 '09 at 21:03
If there was no error message, are you sure it didn't work? – Liudvikas Bukys Jul 22 '09 at 21:17
check /etc/passwd to see if the shell assigned to postgres is a valid one. check /etc/shells too. – sybreon Jul 23 '09 at 11:11

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.