Access remote folders using ssh

To access my files using ssh i use sshfs, sshfs is a “FUSE” (Filesystem in Userspace) for ssh. Technically it puts your remote filesystem in your computer as it was in your computer using the secure ssh connection . I install sshfs using my distribution package manager and edit my fstab config file sudo nano /etc/fsab

I then add the following line : mathieu@connectemoi.eu:/media /mnt/nas fuse.sshfs noauto,x-systemd.automount,_netdev,IdentityFile=/home/mathieu/.ssh/id_ed25519,allow_other 0 0

  • mathieu@connectemoi.eu:/media tells the system to connect using user mathieu to the remote server connectemoi.eu to access the /media folder
  • /mnt/nas is the folder on the local computer
  • fuse.sshfs tells the system that the filesystem type is sshfs
  • noauto not automatically mount the filesystem
  • x-systemd.automount automount if necessary
  • _netdev the filesystem is a network filesystem
  • IdentityFile=/home/mathieu/.ssh/id_ed25519 use this keyfile to authenticate using ssh

If I want to access my remote files on my server i have just to type mount /mnt/nas and go to the folder /mnt/nas


MG1

untagged

155 Words

2023-09-09 13:50 +0200

.