libfuse / sshfs

A network filesystem client to connect to SSH servers
GNU General Public License v2.0
6.04k stars 496 forks source link

Allow to set global config in /etc/sshfs.conf #290

Open baryluk opened 11 months ago

baryluk commented 11 months ago

I often use sshfs on livecd (that I build), or to many other computers, and often need a bunch of parameters (caching, reconnects, keep alive, other_allow, max_conns, etc), every time. I sometimes do create bash aliases or custom script for this, but I sometimes forget.

I would really love to have /etc/sshfs.conf which has extra arguments that are parsed first by sshfs.

Currently it looks like there is no way do do this, other than maybe providing own sshfs script in /usr/local/bin/

sshfs 3.7.3-1.1, Debian testing

EbiSadeghi commented 8 months ago

If I understand the suggestion correctly, the SSHFS code would check the config file for stuff like max_conns=5, so that you don't have to redo that everytime.

But I am a little confused as to how this suggestion would handle something like SSHOPT ChannelTimeout, as that relates back to ssh config.

I haven't contributed to this repo before, but it seems like a cool suggestion I could take on, just want to make sure I understand the nuances.

baryluk commented 7 months ago

If I understand the suggestion correctly, the SSHFS code would check the config file for stuff like max_conns=5, so that you don't have to redo that everytime.

Yes exactly.

For example I usually have -o allow_other -o reconnect -o ServerAliveInterval=7 -o dir_cache=yes -o transform_symlinks , and sometimes also -o max_conns=8 or similar. And put custom wrapper script called sshfs in /usr/local/bin/ so that adds these options, otherwise I do forgot, and then you find hours later that there are issues (like broken mount points).