frany
frany

Reputation: 51

run python script with arguments on a remote linux host

I have this python script that I'm trying to run on a remote host. However, the script requires two arguments. For example, python script.py --port 4000 --service status

Now when I run the script locally on the machine it works fine. How can I run this same script on a remote linux machine. I've tried ssh user@remotehost python script.py --port 4000 --service status This doesn't work. The arguments are not passed in.

Thank you

Upvotes: 1

Views: 1772

Answers (1)

Anand S Kumar
Anand S Kumar

Reputation: 90889

You should use the following -

ssh user@remotehost "python script.py --port 4000 --service status"

Please notice the " double quotes, it has to be double quotes.

Upvotes: 2

Related Questions