A small Python script that mounts ssh mount points using authentication from your .netrc (or alternatively .authinfo) file.
You will need the sshfs
package installed and in the PATH
.
On Arch linux it is located in the Community repo. You can install it using:
pacman -S sshfs
python setup.py install
Your netrc file should have a line matching the following pattern:
machine my_server_name login my_login password my_password
Its simplest form:
sshmount-netrc my_server_name
Specifying a custom mount point:
sshmount-netrc -m my_mount_point my_server_name
Specifying a custom netrc location:
sshmount-netrc -f ~/.authinfo my_server_name
If no mountpoint is specified the following default will be used
~/mnt/my_login@my_server_name
Under the hood, this script will then execute the following linux commad:
echo my_password | sshfs -o password_stdin my_login@my_server_name: /my_mount_point
Currently you cannot have multiple logins on one machine. This is due to a long standing shortcoming in the Python netrc library. At the time of writing the bug describing it has not been resolved: http://bugs.python.org/issue11416