How to use SSHFS as a regular user in fstab?

How to use SSHFS as a regular user in fstab?

Using option allow_other in /etc/fstab allows other users than the one doing the actual mounting to access the mounted filesystem. When you booting your system and mounting your sshfs, it’s done by user root instead of your regular user.

How does Linux mount with sshfs and write file permissions?

When you give the option default_permissions in fusermount then fuse’s permission control of the fuse mount is handled by the kernel and not by fuse. This means that the REMOTE_USER’s uid/gid aren’t mapped to the LOCAL_USER (sshfs.c IDMAP_NONE).

Why is SSHFS not mapped to remote user?

This means that the REMOTE_USER’s uid/gid aren’t mapped to the LOCAL_USER (sshfs.c IDMAP_NONE). It works the same way as a simple nfs fs without mapping. So, it makes sense to prohibit the access, if the uid/gid numbers don’t match.

Which is the best syntax for SSHFS syntax?

You should prefer the [user]@ [host] syntax over the sshfs# [user]@ [host] one. Make sure you use each sshfs mount at least once manually while root so the host’s signature is added to the .ssh/known_hosts file.

Is it possible to mount a fuse partition in fstab?

Since version version 2.4.0, it is possible to use fstab to mount those kind of partition. The current version installed on ubuntu dapper is fuse-utils-2.4.2. Unfortunately, /sbin/mount.fuse is not included in the package. I’ve recompiled it, submitted to revu, hopefully it is going to make its way up to the main repository.

How to mount a FUSE filesystem from the command line?

The packages we are going to need are fuse-utils and sshfs. Download fuse-utils_2.4.2-0ubuntu3_i386.deb and install it: will not mount the filesystem automatically during boot (noauto) and will let a non-privileged user (but belonging to fuse group) to mount the filesystem from the command line.

How to Mount SSHFS as a regular user?

Make sure you use each sshfs mount at least once manually while root so the host’s signature is added to the .ssh/known_hosts file. Also, complementing the accepted answer: there is a need that the user on the target has a right to shell, on target machine: sudo chsh username -> /bin/bash.

Is there a way to Mount SSHFS without a password?

Computer users can mount SSHFS without public key by using the password_stdin option, but not with fstab. Using public key is a better choice for users; however, public key does not work some time. Script file should contain a password, and users have to make sure that only root has permission to the script file.

Where do I find the fstab file on my computer?

The file, fstab is located under /etc, and /etc/fstab is the full path to this file. /etc/fstab contains information about where your partitions and storage devices should be mounted and how. Computer users often ask the following questions: Why is SSHFS always asking for a password in fstab?

Is it possible to use SSH without a password?

SSH does not allow a password that is stated from the command line. Some users ask: Can they use SSHFS without the requirement of a password? The answer to this question is simply: Yes. Users can definitely use SSHFS without using the password.