I want to mount a remote directory and I want to automate this. So I write below script which not working properly.
#!/usr/bin/expect -f
spawn sshfs [email protected]:/home/user /mnt/remote
expect "assword:"
send "myPassword\r"
When I run the above script and if check ls /mnt/remote
, it is giving below error:
ls: cannot access /mnt/remote: Transport endpoint is not connected
I used sshpass
but not working:
sshpass -p myPassword sshfs [email protected]:/home/user /mnt/remote
Shell blocked and getting the same error.
Note: If I run sshpass -p vedams123 sshfs [email protected]:/home/user /mnt/remote
, working withour any problem.