How to execute a shell script that resides in another server?

hi,

i have a shellscipt that is in another server, my question is how do i run the script from a different server.

EXAMPLE:

SCRIPT_NAME: sample.sh
SERVER: A

what i wanted to achieve is to call that script from server B. Tried using ssh

ssh <username>@serverB /home/sample.sh

but it is asking me for a password.

Cheers,

Passwordless entry using ssh: Link

is there no other alternative?

You could use expect to enter the password for you when ssh prompts for the password

can you please show me how to do it?:slight_smile:

Here, let me google that for you

1 Like