ssh to remote server and switch user
by rparavastu from LinuxQuestions.org on (#5DQ9E)
Hi all,
I have installed sshpass.
I am using sshpass and ssh to login to remote server.
Once I log into to the remote server I would like to switch to webapp user for which I would like to pass the password from the same command line where I initiated the sshpass on my terminal.
example:
sshpass -f passfile ssh myself@abc.com 'su - webapp'
The above command cnnects to abc.com host and asks for password and when I type the password is visible what I type, and fails to switch to webapp user.
Can someone help?
Thanks,
Ram.


I have installed sshpass.
I am using sshpass and ssh to login to remote server.
Once I log into to the remote server I would like to switch to webapp user for which I would like to pass the password from the same command line where I initiated the sshpass on my terminal.
example:
sshpass -f passfile ssh myself@abc.com 'su - webapp'
The above command cnnects to abc.com host and asks for password and when I type the password is visible what I type, and fails to switch to webapp user.
Can someone help?
Thanks,
Ram.