Skip to main content

ssh mount using passwords saved in .netrc

Project description

* sshmount-netrc
A small Python script that mounts ssh mount points using authentication from your .netrc (or alternatively .authinfo) file.

** Dependencies
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:
#+begin_src bash
pacman -S sshfs
#+end_src


** Installation
#+begin_src bash
python setup.py install
#+end_src

** Usage
*** netrc configuration
Your netrc file should have a line matching the following pattern:

#+BEGIN_EXAMPLE
machine my_server_name login my_login password my_password
#+END_EXAMPLE




*** command
Its simplest form:
#+begin_src bash
sshmount-netrc my_server_name
#+end_src

Specifying a custom mount point:
#+begin_src bash
sshmount-netrc -m my_mount_point my_server_name
#+end_src

Specifying a custom netrc location:
#+begin_src bash
sshmount-netrc -f ~/.authinfo my_server_name
#+end_src


*** default mount point
If no mount_point is specified the following default will be used
#+begin_src bash
~/mnt/my_login@my_server_name
#+end_src

*** result
Under the hood, this script will then execute the following linux commad:
#+begin_src bash
echo my_password | sshfs -o password_stdin my_login@my_server_name: /my_mount_point
#+end_src

** Limitation
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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sshmount-netrc-0.1.3.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file sshmount-netrc-0.1.3.tar.gz.

File metadata

File hashes

Hashes for sshmount-netrc-0.1.3.tar.gz
Algorithm Hash digest
SHA256 81e3d30c8a8235fc0ab8f072eb7233da66919525381e8a41e23edacf1a935ea1
MD5 93fb74a88a23e493d95f69d73297dbb8
BLAKE2b-256 c5885def0186148dd8ca43779bb23b87abf6f13a6e6f9b3a1d210f51f8c519f9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page