I’m running the command /usr/bin/ssh 192.168.0.109 using Python’s subprocess module. However, I’m getting a “File Not Found” error even though I’m using absolute paths.
OSError: Cannot run program "/usr/bin/ssh 192.168.0.109" (in directory "/home/max/repo/vssh/vssh"): java.io.IOException: error=2, No such file or directory
I’m working in my home directory, but this should matter seeing as I’m giving the full path right?
Here’s where the error occurs:
current_session = Popen(["/usr/bin/ssh " + x.address], stdin=PIPE, stdout=PIPE)
(oh and /usr/bin/ssh does exist)
You should pass in a list of strings to
Popen, not a shell command line.That should work better.