slash
2024-02-13 18:13:51 UTC
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
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
--
/
/