Discussion:
sshfs +cryptsetup volume, what's wrong?
(too old to reply)
slash
2024-02-13 18:13:51 UTC
Permalink
Hi all,

I'm trying to create/mount an encrypted volume on an sshfs mount. This
is what I do:

#1 I mount a remote directory:
***@darkstar:~$ sshfs remotehost:/home/slash/ /mnt/remotehost/
Enter passphrase for key '/home/slash/.ssh/id_rsa':

#2 I create a volume:
***@darkstar:~$ dd if=/dev/zero of=/mnt/remotehost/myvol.luks bs=50M
count=1
1+0 records in
1+0 records out
52428800 bytes (52 MB, 50 MiB) copied, 4.49761 s, 11.7 MB/s

#3 Encrypt the volume:
***@darkstar:~$ cryptsetup -y -v -s 512 -c aes-xts-plain64 -h sha512
--use-random luksFormat /mnt/remotehost/myvol.luks

WARNING!
========
This will overwrite data on /mnt/remotehost/myvol.luks irrevocably.

Are you sure? (Type 'yes' in capital letters): YES
Enter passphrase for /mnt/remotehost/myvol.luks:
Verify passphrase:
Key slot 0 created.
Command successful.

#4 Open the encrypted volume:
***@darkstar:~$ sudo cryptsetup -v luksOpen /mnt/remotehost/myvol.luks
myvol
Device /mnt/remotehost/myvol.luks does not exist or access denied.
Command failed with code -4 (wrong device or file specified).

#######################################################################################
Why do I get this error? The file exists, the remote directory is mounted:
#######################################################################################

***@darkstar:~$ mount
remotehost:/home/slash/ on /mnt/remotehost type fuse.sshfs
(rw,nosuid,nodev,relatime,user_id=1000,group_id=100)

***@darkstar:~$ ls -hal /mnt/remotehost/
-rw-r--r-- 1 slash users 50M Feb 13 18:50 myvol.luks
--
/
Petri Kaukasoina
2024-02-13 20:46:31 UTC
Permalink
...
Post by slash
Device /mnt/remotehost/myvol.luks does not exist or access denied.
By default, root can't access your fuse fs. You can add '-o allow_root' to
the sshfs command. To be able to add that as a regular user, you also need
'user_allow_other' in /etc/fuse.conf. See 'man mount.fuse'.
Erte Ribbile
2024-02-14 08:47:40 UTC
Permalink
Post by Petri Kaukasoina
...
Post by slash
Device /mnt/remotehost/myvol.luks does not exist or access denied.
By default, root can't access your fuse fs. You can add '-o allow_root' to
the sshfs command. To be able to add that as a regular user, you also need
'user_allow_other' in /etc/fuse.conf. See 'man mount.fuse'.
Thanks Petri, 'sshfs -o allow_root...' did the trick.
'user_allow_other' in /etc/fuse.conf was already there.

Loading...