[gentoo-user] How to automate an sshfs (fusermount) mounted share
I'm sshfs mounting an solaris zfs file system in the interactive fashion. sshfs $USR@HOST:/file/system MOUNTPOINT passwd? enter passwd RETURN Once mounted I run an rsnapshot backup onto the mounted FS. Any ideas on how to go about doing this mount automatically (scripted) will be greatly appreciated.
Re: [gentoo-user] How to automate an sshfs (fusermount) mounted share
Hi, On Sat, 03 Jan 2015 09:23:29 -0500 Harry Putnam wrote: I'm sshfs mounting an solaris zfs file system in the interactive fashion. sshfs $USR@HOST:/file/system MOUNTPOINT passwd? enter passwd RETURN Once mounted I run an rsnapshot backup onto the mounted FS. Any ideas on how to go about doing this mount automatically (scripted) will be greatly appreciated. 1) Set up your ssh to use keys. Key itself should not be protected by password (or manual intervention will be needed on each mount). 2) Add sshfs command to your .bash_profile (or whatever login shell you're using) with check that filesystem is not mounted already, something like: grep -q $MOUNTPOINT || sshfs $USR@HOST:/file/system MOUNTPOINT Alternatively you may add this to your DE/WM autostart scripts, if you are using GUI logins only. Best regards, Andrew Savchenko pgpJvFFahiIWL.pgp Description: PGP signature
Re: [gentoo-user] How to automate an sshfs (fusermount) mounted share
On 15-01-03 at 18:42, Andrew Savchenko wrote: Hi, On Sat, 03 Jan 2015 09:23:29 -0500 Harry Putnam wrote: I'm sshfs mounting an solaris zfs file system in the interactive fashion. sshfs $USR@HOST:/file/system MOUNTPOINT passwd? enter passwd RETURN Once mounted I run an rsnapshot backup onto the mounted FS. Any ideas on how to go about doing this mount automatically (scripted) will be greatly appreciated. 1) Set up your ssh to use keys. Key itself should not be protected by password (or manual intervention will be needed on each mount). 2) Add sshfs command to your .bash_profile (or whatever login shell you're using) with check that filesystem is not mounted already, something like: grep -q $MOUNTPOINT || sshfs $USR@HOST:/file/system MOUNTPOINT Alternatively you may add this to your DE/WM autostart scripts, if you are using GUI logins only. Or just add it to /etc/fstab: user@host:/mountpoint /where/to/mount fuse.sshfs rw,exec,async,_netdev,auto,user,idmap=user,transform_symlinks,identityfile=/path/to/ssh/key,allow_other,default_permissions,uid=1000,gid=100 0 0 Check the manpages for which of those options you want. ie, you might want to get rid of allow_other etc. -- Simon Thelen
Re: [gentoo-user] How to automate an sshfs (fusermount) mounted share
Iirc you may need to initiate a single regular ssh connection so you can accept the servers key and have it added to the clients known hosts file, first.