/dev/sda is the whole raw disk - you typically don’t want to directly interact with /dev/sda, unless you are partitioning or overwriting it. There are a few layers between that device and the files:
- raw disk - /dev/sda
- disk partition - /dev/sda1
- luks container - when unlocked, mapped to /dev/mapper/{name}
- ext4 filesystem inside the luks container, mounted somewhere like /mnt, /media, etc
You’ll need to find where that ext4 filesystem is mounted, and run the chown command on that. You can run lsblk
and see a tree of the above hierarchy, with the ext4 filesystem’s mountpount shown in the right-hand column.
If you’re trying to have password auth be a second layer on top of key auth (requiring a password after connecting with your ssh key), you can add the following to your server’s sshd_conf:
AuthenticationMethods "publickey,password"