Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So I have this file stored in my account. It's postgres dump. To be able to use postgres it seems that I have to execute the following command 'sudo su - postgres'. Once I do this I am now working as the 'postgres' user. What I need to be able to do is use the dump file (tied to my account 'ahcarpenter') as the 'postgres' user. Any ideas as to how to go about this?

Or really simply just access the file located within my other account's directory within the postgres user's directory.

share|improve this question
add comment

1 Answer 1

If the file does not contain sensitive information, simply flag it as readable by anyone:

chmod o+r yourdumpfile

And then use it from the postgres user.

If it does contain sensitive information, then you should copy it to the postgres users's home directory, and chown it to them:

chown postgres /path/to/postgres/home/yourdumpfile
share|improve this answer
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.