# Cannot mount encrypted volume when logging over ssh

## kolcon

Hello,

I have setup encrypted  /home partition and it works well when the user logs in 

on the computer directly (login, su, gdm).

But I have two problems:

1) When I login over ssh, the partition is not mounted.

In the log I get :

Dec 30 08:17:13 localhost sshd[4776]: Accepted keyboard-interactive/pam for aaaa from 192.168.2.104 port 42912 ssh2

Dec 30 08:17:13 localhost sshd[4776]: pam_mount(pam_mount.c:172): conv->conv(...): Conversation error

Dec 30 08:17:13 localhost sshd[4776]: pam_mount(pam_mount.c:476): warning: could not obtain password interactively either

Dec 30 08:17:15 localhost sshd[4776]: pam_mount(mount.c:64): Errors from underlying mount program:

Dec 30 08:17:15 localhost sshd[4776]: pam_mount(mount.c:6 :Cool: : crypt_activate_by_passphrase: Operation not permitted

Dec 30 08:17:15 localhost sshd[4776]: pam_mount(pam_mount.c:521): mount of /dev/md2 failed

Dec 30 08:17:15 localhost sshd[4776]: pam_mount(pam_mount.c:172): conv->conv(...): Conversation error

Dec 30 08:17:15 localhost sshd[4776]: pam_mount(pam_mount.c:476): warning: could not obtain password interactively either

Dec 30 08:17:15 localhost sshd[4776]: pam_unix(sshd:session): session opened for user aaaa by (uid=0)

I tried modifications of sshd, but no success. 

2) partition is not umounted when logging out

pam_mount(spawn.c:102): error setting uid to 0

pmvarrun(pmvarrun.c:453): could not unlink /var/run/pam_mount/aaaa: Permission denied

pam_mount(spawn.c:102): error setting uid to 0

pam_mount(mount.c:64): umount messages:

pam_mount(mount.c:6 :Cool: : umount: only root can unmount /dev/md2 from /home

pam_mount(mount.c:722): unmount of /dev/md2 failed

What permissions is it missing?

Thank you for any hint.

----------

## o5gmmob8

Hi kolcon,

When it is trying to unmount the partition, those errors are probably being thrown because it's not mounted.

Can you post your configuration files?  I am struggling to even get mine to mount at all.  Perhaps I can help once I get mine to that level of functioning.  When I login, I don't see anything regarding pam_mount in my logs.

Walter

----------

