skip to Main Content

I have two Debian Linux servers on the same network. I would like server A to execute this command on server B: run.sh VARIABLE, and it needs to be able to process the output of said command. The script run.sh is on server B I do not want its contents to be visible to server A. I need there to be some kind of authentication between these two machines as well.

2

Answers


  1. Perhaps the easiest and fastest way you can accomplish this is to setup a standalone python REST server. On the client side you can use any client, even curl or python requests.

    How to make a simple Python REST server and client?

    As authentication it can be as simple as requiring a username and password in the JSON fields.

    Login or Signup to reply.
  2. Your specs are somewhat vague. Assuming that run.sh exists somewhere on server B, the easiest would be to use an ssh forced command and using a key-pair for the ssh connection.

    You define the forced command in the ~/.ssh/authorized_keys on server B and pull the VARIABLE out of SSH_ORIGINAL_COMMAND in run.sh.

    server A never gets to see run.sh, is able to pass arguments to run.sh. and running run.sh is all it can ever do …

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search