1

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

1
  • 2
    sss user@foo 'put remote command in quotes'. Commented Jun 18, 2015 at 18:43

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

What version of ssh are you using? I can use single quotes. ssh -V -> OpenSSH_6.6.1p1 Ubuntu-2ubuntu2, OpenSSL 1.0.1f 6 Jan 2014

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.