Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

migrated from stackoverflow.com Jul 22 '09 at 21:09

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

1 Answer

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.

Try:

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
add comment

Your Answer

 
discard

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.