AutoFS and sshfs not working together

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
rujikin
Level 2
Level 2
Posts: 53
Joined: Fri Aug 21, 2015 11:19 pm

AutoFS and sshfs not working together

Post by rujikin »

I am trying to get Autofs to work with sshfs kind of like how its listed here:

http://www.tjansson.dk/2008/01/autofs-a ... ct-couple/
https://www.digitalocean.com/community/ ... s-over-ssh

However I think the autofs instructions might be a bit dated because some options listed are not valid today.

I've gotten sshfs to connect and it seems like it works how I hoped it would work with:

Code: Select all

sshfs -o allow_other,default_permissions,uid=1000,gid=1000,IdentityFile=/home/sovereign/.ssh/remote remoter@192.168.1.100: /home/sovereign/remoter/
I put that into autofs like so:

auto.master

Code: Select all

# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#
#/misc  /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#       "nosuid" and "nodev" options unless the "suid" and "dev"
#       options are explicitly given.
#
#/net   -hosts
#
# Include /etc/auto.master.d/*.autofs
#
+dir:/etc/auto.master.d
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master
/home/sovereign/.remotefiles/ /etc/auto.sshfs
auto.sshfs

Code: Select all

remoter allow_other,default_permissions,uid=1000,gid=1000,IdentityFile=/home/sovereign/.ssh/remoter :sshfs\#remoter@192.168.1.100\:
I made the .remotefiles/remoter directories and they mount fine using the direct sshfs command. I just can't seem to figure out whats going on with autofs.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
OS: Linux Mint Cinnamon
mrmajik45

Re: AutoFS and sshfs not working together

Post by mrmajik45 »

Autofs instructions were from 2008. Also mint uses 18.04 now. Not 16.04 anymore. So it may be not compatible.
rujikin
Level 2
Level 2
Posts: 53
Joined: Fri Aug 21, 2015 11:19 pm

Re: AutoFS and sshfs not working together

Post by rujikin »

mrmajik45 wrote: Thu Jan 17, 2019 2:41 pm Autofs instructions were from 2008. Also mint uses 18.04 now. Not 16.04 anymore. So it may be not compatible.
Oh yeah. Using Mint 17.3 and transitioning to 19.1.

It seems autofs was installed already so I didn't reinstall or modify that beyond configs. Didn't want to break anything. Looks like mint has some autofs modules installed by default.

It would be nice if I could get this to work how they spoke of it. I don't need it at all times.
OS: Linux Mint Cinnamon
rujikin
Level 2
Level 2
Posts: 53
Joined: Fri Aug 21, 2015 11:19 pm

Re: AutoFS and sshfs not working together

Post by rujikin »

Never got autofs working but I am just starting it using startup programs. Works well enough till I or someone can figure out autofs. Just input the sshfs into custom command and works on startup.
OS: Linux Mint Cinnamon
ajgringo619

Re: AutoFS and sshfs not working together

Post by ajgringo619 »

rujikin wrote: Thu Jan 17, 2019 2:37 pm
<snip>

auto.sshfs

Code: Select all

remoter allow_other,default_permissions,uid=1000,gid=1000,IdentityFile=/home/sovereign/.ssh/remoter :sshfs\#remoter@192.168.1.100\:
You need a dash in front of the options, like this:

Code: Select all

remoter -allow_other,default_permissions,uid=1000,gid=1000,IdentityFile=/home/sovereign/.ssh/remoter :sshfs\#remoter@192.168.1.100\:
Do you have autofs starting on boot-up?

Code: Select all

sudo systemctl enable autofs
Locked

Return to “Software & Applications”