script-server icon indicating copy to clipboard operation
script-server copied to clipboard

Remote server for script ?

Open Antoine2tt opened this issue 3 years ago • 3 comments

Hello !

I'd like to know, if it's possible to execute script on a remote server.

I explain :

Script server is on machine A

My script is on machine B

Can script server kind of ssh to the machine B, and then run the script ?

(In other words, can the script be executed while script server is on another machine?)

Thanks !

Antoine2tt avatar Sep 07 '21 12:09 Antoine2tt

just use ssh keys on both servers and write a wrapper script

muzzol avatar Sep 07 '21 12:09 muzzol

just use ssh keys on both servers and write a wrapper script

That's not something i know know how to

But thanks anyway, I've my answer

Antoine2tt avatar Sep 07 '21 13:09 Antoine2tt

just use ssh keys on both servers and write a wrapper script

That's not something i know know how to

But thanks anyway, I've my answer

@antoine2tt I assume you have some basic knowledge about your linux distribution, like how to install a package.

  • Install openssh-client if missing
  • Generate a ssh-key without password to use for logging in : ssh-keygen -t rsa -b 4096
  • Then copy the public key to Machine B: ssh-copy-id userNameToRunAs@machineb

Now you can login without a password: ssh userNameToRunAs@machineb In order to run a script or command; ssh userNameToRunAs@machineb 'ls -la /tmp'

remote_script.json

{
  "name": "Remote Script",
  "script_path": "ssh userNameToRunAs@machineb 'ls -la'",
  "output_format": "terminal",
  "parameters": []
}

agail avatar Sep 17 '21 17:09 agail