(1) "that is asking me for the current user's password" – Do you want to be asked
dp-postgres
's password? or to be allowed without any password? (2) "and then after execute any command" – Do you mean "any command not known in advance"? i.e. do you want an interactive shell? Or do you mean any command known in advance, like echo hello
in your example? Please [edit] and clarify. (3) echo 'echo hello' | sudo su - dp-postgres
may or may not work. Try and report back ([edit]) (4) Properly configured and used sudo
without su
may suffice. Or su
without sudo
, depending on what you want.