can someone tell me, how I can run a bash script on a remote host with sshpass?
Is this possible?
Thanks for your help & best regards
can someone tell me, how I can run a bash script on a remote host with sshpass?
Is this possible?
Thanks for your help & best regards
First you have to install sshpass.
sudo apt-get install sshpass
Now try the following command this worked for me.
sshpass -p pass ssh -t user@192.168.XX.XXX 'ls; bash -l'
Remember to replace 'pass' with the server password and 'user' with the username.(also put correct host address).
suppose password is student and username is student and host address is 192.168.118.104 Then your command looks like this
sshpass -p student ssh -t student@192.168.118.104 'ls; bash -l'