fstab parse-error with sshfs

David Fletcher dave at thefletchers.net
Wed Mar 30 13:21:30 UTC 2022


On Wed, 2022-03-30 at 14:30 +0200, robert rottermann wrote:
> Hi Friends
> 
> I try to mount a remote folder using sshfs.
> 
> doing so manually works fine:

I've had something set up for quite a while that auto mounts
directories on my server for personal access only when I log in. It
would be nice if I could get it to auto umount them when I log out but
could never find out how.

To the end of ~/.profile I added
$HOME/StartupScripts/ServerMounts

then put into ServerMounts
#!/bin/bash

if [ ! -n "$SSH_CLIENT" ] && [ ! -n "$SSH_TTY" ]
then
    if [ ! -d "/home/dave/ServerWork/Records" ]
    then
        sshfs dave at server:/home/dave/Work/ /home/dave/ServerWork/
    fi
# Repeat as necessary
fi

"Records" is any subdirectory in my Work directory to detect if it's
already mounted and not try to do it again.

Dave





More information about the ubuntu-users mailing list