Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- here: http://hublog.hubmed.org/archives/001928.html
- >Install sshfs and autofs:
- #sudo aptitude install sshfs autofs
- >Add yourself to the fuse group:
- #sudo gpasswd -a $USER fuse
- >Log out and in again.
- >Generate a private key (~/.ssh/id_dsa_open) without passphrase, and a corresponding public key (~/.ssh/id_dsa_open.pub):
- #ssh-keygen -t dsa -f ~/.ssh/id_dsa_open
- (press enter to keep the passphrase empty; it has to be passphrase-less, because autofs runs as root so can't use your ssh-agent to handle the passphrase)
- >Copy the public key into ~/.ssh/authorized_keys on the remote host:
- #ssh-copy-id -i ~/.ssh/id_dsa_open.pub [email protected]
- >Test that root can log into the remote host using the new key pair:
- #sudo ssh -i ~/.ssh/id_dsa_open [email protected]
- >Add a new entry to /etc/auto.master:
- -------------------------------------------------
- /media/sshfs /etc/auto.sshfs --timeout=3600 --ghost --verbose
- >Add one or more entries to /etc/auto.sshfs:
- --------------------------------------------------
- foldername -fstype=fuse,rw,allow_other,noatime,IdentityFile=/home/localusername/.ssh/id_dsa_open :sshfs\#[email protected]\:/path/to/folder
- >(replacing "foldername" (the name of the local folder that will be created), "localusername", and the sshfs information as appropriate)
- Restart autofs:
- #sudo restart autofs
- >Open /media/sshfs - the remote folder(s) should now be mounted there.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement