I want to log through SSH as user@remote and then change the user to tomcat, move files to $CATALINA_HOME/webapps and re-start the tomcat server in the same script.
ssh user@remote sudo -i -u tomcat ...
sh -c 'multiple; commands; here'
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
5 years ago