# [SOLVED] dm-crypt+luks - mounting as regular user

## Holysword

Today I stumbled upon a problem.

I have recently encrypted my external hard driver with a keyfile (which is in another partition of the same hard driver). But only when I brought it to my friend's place (he is running Ubuntu) I realized that there was a problem. I can mount it via command line with cryptsetup luksOpen /dev/sdX /mnt/path -d /keyfile but that usually requires root permission. Now, Ubuntu does allow regular users to mount devices without need to sudo, even for encrypted devices using passphrases, but is there any way to do the same with an encrypted device?

----------

## DawgG

i use a luks-encrypted home-partition on my laptop; when the user logs in, it is mounted with pam_mount. i use a passphrase but i am certain pam_mount works with keyfiles also. the initial setup (a long time ago) was a little tricky at first, but since then it's been working reliably - so i think pam_mount is definitely worth a try.

GOOD LUCK!

----------

## Holysword

 *DawgG wrote:*   

> i use a luks-encrypted home-partition on my laptop; when the user logs in, it is mounted with pam_mount. i use a passphrase but i am certain pam_mount works with keyfiles also. the initial setup (a long time ago) was a little tricky at first, but since then it's been working reliably - so i think pam_mount is definitely worth a try.
> 
> GOOD LUCK!

 

Ancient question, which I forgot to answer. I don't know exactly which functionality is doing that, but I started using plasma-desktop and it took care of it. I'd plug in the device, the notification would pop up, I enter the password, it mounts. Quite handy.

----------

