Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sshfs +cryptsetup volume, what's wrong?

19 views
Skip to first unread message

slash

unread,
Feb 13, 2024, 1:15:21 PMFeb 13
to
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:
slash@darkstar:~$ sshfs remotehost:/home/slash/ /mnt/remotehost/
Enter passphrase for key '/home/slash/.ssh/id_rsa':

#2 I create a volume:
slash@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:
slash@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:
slash@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:
#######################################################################################

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

slash@darkstar:~$ ls -hal /mnt/remotehost/
-rw-r--r-- 1 slash users 50M Feb 13 18:50 myvol.luks


--
/

Petri Kaukasoina

unread,
Feb 13, 2024, 3:46:34 PMFeb 13
to
slash <sl...@invalid.invalid> wrote:
>slash@darkstar:~$ sshfs remotehost:/home/slash/ /mnt/remotehost/
...
>slash@darkstar:~$ sudo cryptsetup -v luksOpen /mnt/remotehost/myvol.luks myvol
>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

unread,
Feb 14, 2024, 3:47:43 AMFeb 14
to
Thanks Petri, 'sshfs -o allow_root...' did the trick.
'user_allow_other' in /etc/fuse.conf was already there.
0 new messages