-2

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.

starball
  • 20,030
  • 7
  • 43
  • 238
Anonymous
  • 61
  • 1
  • 7

2 Answers2

1

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 ...

tink
  • 14,342
  • 4
  • 46
  • 50
0

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.