how to use sshpass to chain commands?

19 Views Asked by At

I want to use sshpass to run some commands

I have the following command:

sshpass -p 'PASSWORD' ssh -o StrictHostKeyChecking=no user@hostname "sudo su - someOtherUser; mkdir -p ${HOME}/apps/testApp/; cd ${HOME}/apps/testApp/; git clone <gitRepo>"

However, the operation hangs. I assume it's sudo su - kdb command used to change users when connecting to my server

0

There are 0 best solutions below