Error while mounting with pam_mount

My goal is, that for every user the home-directory is mounted automatically while login. I’ve added the line
<volume fstype=“cifs” server=“192.168.178.31” options=“sec=krb5,vers=3.0” path="%(USER)" mountpoint="/home/%(USER)" > <not><user>root</user></not> <not><user>sddm</user></not> <not><user>nx</user></not> </volume>
to my /etc/security/pam_mount.conf.xml file.
But when I login as another user (for example the later used synrom), I get the Error:
mount error(2): No such file or directory

However the command
mount -t cifs -o username=synrom,password=asdf //192.168.178.31/synrom /mnt/tmp
just works fine.

Thanks for help
Synrom

try to replace mountpoint="/home/%(USER)" with mountpoint="~/"

rg
Christian

Thank you for your advice. I replaced it; still the same error message.
Max

Maybe the variable is wrong try $USER instead of %(USER)

rg
Christian

Again thank you for the advice. I tried it and unfortunately it didnt work.
But thankfully i found the right solution.

Replace:
<volume fstype=“cifs” server=“192.168.178.31” options=“sec=krb5,vers=3.0” path="%(USER)" mountpoint="~/"> <not><user> root </user></not> <not><user>sddm</user></not> <not><user>nx</user></not> </volume>
With:
<volume fstype=“cifs” server=“192.168.178.31” options=“vers=3.0” sec=“krb5i” path="%(USER)" mountpoint="~/"> <not><user> root </user></not> <not><user>sddm</user></not> <not><user>nx</user></not> </volume>
worked for me.
I got this from: Ubuntu 20.04 AD-Join (SSSD&Kerberos) with pam_mount (CIFS)
Nonetheless thank you for the help. I am really overwhelmed by this forum.
Synrom

1 Like
Mastodon