Solution 1: use SSH pre-shared key to login via SSH without a password. See this link for how to do it. After you have configured it properly, you are able to run a command on your server:
ssh hostname-or-ip-of-the-raspi command arg1 arg2 ...
and will execute command arg1 arg2 ...
on the Raspberry PI, without being prompted for a password.
Solution 2: use TCP communication, and write a server for the Raspberry PI and a client for your server. You can use raw sockets, or some high level library such as zmq
.
solved What is the best way to give a Linux command from one machine to a different machine? [closed]