#! /usr/bin/python
import pexpect
import time
username = "계정"
password = "패스워드"
host = "IP "
hostdirectory = "호스트"
mountpoint = "마운트 될 장소 "
option = "-o allow_other -o nonempty"
command = "sshfs " + username + "@" + host + ":" + hostdirectory + " " + mountpoint + " " + option
def start_sshfs():
try:
sshfs = pexpect.spawn(command)
sshfs.expect(username + "@" + host + "'s password: ")
time.sleep (0.1)
sshfs.sendline (password)
time.sleep (10)
sshfs.expect (pexpect.EOF)
except Exception, e:
print str(e)
def main ():
start_sshfs()
if __name__ == '__main__':
main ()