Mounting multiple directories with sshfs using a script
Check this out. I have this script on my laptop for mounting project directories which are located on my desktop computer. By running mount.sh “my password” , I’m able to mount multiple directories on my laptop LIKE a BOSS.
WARNING!! I no longer advice using this technique.
1. I do not advise the use of plain passwords for ssh connections.
2. This method will expose your password in your .bash_history file, and in active process lists (top, ps).
Use at your own risk.
I strongly suggest the use of SSH KEYS for use with sshfs, rsync, ssh, and any other type of ssh operations!
#!/bin/bash # mount.sh echo "$1" | sshfs "amado@killer:/media/G" /media/G -o password_stdin echo "$1" | sshfs "amado@killer:/home/amado" /media/home -o password_stdin echo "$1" | sshfs "amado@killer:/media/V" /media/V -o password_stdin
I’ve also recently discovered ssh with X11 forwarding. This is the coolest thing ever. It allows me to run actual programs and windows ON MY LAPTOP as if they were running locally on my DESKTOP. I can even drag & drop files between local and remote filesystems seamlessly. This means I can work on my laptop as if it were my desktop pc. 133t!