2

I am trying to connect to sshfs with fstab on Ubuntu, but the files are not loading.

In the fstab I put the following :

ssh2@192.1.1.1:/home/ssh2/SSHserver  /home/asir3/Escritorio/SSHclient  fuse.sshfs noauto,x systemd.automount,_netdev,user,idmap=user,follow_symlinks,identityfile=/home/ssh2/.ssh/id_rsa,allowother,default_permissions,uid=1001,gid=1001 0 0

Then I save and make a : mount -a

It doesn't give me any error, it lets me access the folder, but it doesn't synchronise with the server.

The server has the following content :

ssh2@Asir03:~$ tree SSHserver/
SSHserver/
├── ssh1
│   ├── 15.txt
│   ├── 1.txt
│   └── a
│       ├── 150.txt
│       └── 15.txt
├── ssh1.txt
├── ssh2
│   ├── pepa.txr
│   ├── pepa.txt
│   └── pepe.txt
├── ssh2.txt
└── ssh3
    ├── gema.txt
    ├── javi.txt
    ├── juan.txt
    └── marina.txt

4 directories, 13 files

ssh2@Asir03:~$ 

And this is what I get in the client:

asir3@Asir03:~/Escritorio$ tree SSHclient/
SSHclient/
└── hola

1 directory, 0 files

asir3@Asir03:~/Escritorio$ 

It lets me add folders, files and so on, but it doesn't save on the server.

1
  • 1
    you definitely also want to add reconnect to the options, or else your file system will become a complete hang-up if anything gets disconnected – be it because of your network connection, due to the server dropping your client, or any other reason. Still, sshfs is not something I'd recommend to have permanently mounted - any communication error results in half-written files and there's no way to know the state or recover from that. Really, just a "deploy this quickly" file system, not something you want to automount! Dec 8 '21 at 13:09
4

noauto means "no automatic mounting", so that this file system is neither mounted at boot nor when doing mount -a. You can, however, as normal user mount it.

16
  • so if i replace by auto and do the mount -a ready? Dec 8 '21 at 12:53
  • if mount /home/asir3/Escritorio/SSHclient works right now, then yes Dec 8 '21 at 13:00
  • note that this will also mount things at boot, and that means if the remote server isn't reachable, your boot process might hang Dec 8 '21 at 13:01
  • I already knew that but it should be done in the fstab file as requested in the exercise in the previous question and I already mounted it and it worked. But thank you very much anyway. Dec 8 '21 at 13:02
  • I set it up like this : sshfs ssh2@192.1.1.1:/home/ssh2/SSHserver /home/asir3/Escritorio/SSHclient Dec 8 '21 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.