script-server
script-server copied to clipboard
Remote server for script ?
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 !
just use ssh keys on both servers and write a wrapper script
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
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": []
}