You can execute shell commands remotely using ssh.
man ssh has more info than you'll ever want -- here's the essential info:
Let's call the host on which you want the commands to run the target, and the host requesting it the client.
- Generate a key using ssh-keygen on the client, using the account that will be making the requests. Accept the default value for any prompts.
- Copy the public key (default file name is ~/.ssh/id_rsa.pub) to the target machine, and append to the file ~/.ssh/authorized_keys for the user that will run the commands. You can do this via
cat id_rsa.pub >>~/.ssh/authorized_keys
From the client, you should be able to run commands on the target with a command like
ssh -luser target command
where user is the username to use on the target (can be omitted if same user as the client)
target is the name or ip address of the target
command is the command to execute
An example with a user account jim on target host utilipi might be
ssh -ljim utilipi date
This will run the
date command on utilipi and display the output on the client