Article 5DQ9E ssh to remote server and switch user

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.latest?d=yIl2AUoC8zA latest?i=-PUft9BALjk:byy645tRtv4:F7zBnMy latest?i=-PUft9BALjk:byy645tRtv4:V_sGLiP latest?d=qj6IDK7rITs latest?i=-PUft9BALjk:byy645tRtv4:gIN9vFw-PUft9BALjk
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments