Question

I want to mount a remote directory using sshfs. sshfs working fine from terminal. But how to invoke it from within python script?

I tried something like this - but didn't work at all.

import os

cmd = "/usr/bin/sshfs giis@giis.co.in:/home/giis /mnt" 
os.system(cmd)
Was it helpful?

Solution

first, you should make sure your sshfs command works fine using the shell. Then, go to here to see many examples of using subprocess module of Python to call your sshfs commmand

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top