You are not logged in.

#1 2013-03-04 03:03:34

mylux
Member
Registered: 2012-03-03
Posts: 19

Pam_Mount not mounting CIFS filesystem

Hello Everybody,
I am using my router with it's samba server and I can mount the disk with mount command with no problem.
But I want a little bit more. I want the filesystem to be mount and umounted when I log in or log out, something similar with what Windows does.
So I made some research and found pam_mount and it seems to solve all my problems.

I also found the pam_mount article at the Arch's wiki and I followed those short steps and some others more (because just following the wiki was not enough for me to get it working).

After all, it still doesn't mount anything.

Here is my configuration for pam_mount.conf.xml:

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">
<!--
	See pam_mount.conf(5) for a description.
-->

<pam_mount>

		<!-- debug should come before everything else,
		since this file is still processed in a single pass
		from top-to-bottom -->

<debug enable="1" />

		<!-- Volume definitions -->


		<!-- pam_mount parameters: General tunables -->

<!--
<luserconf name=".pam_mount.conf.xml" />
-->

<!-- Note that commenting out mntoptions will give you the defaults.
     You will need to explicitly initialize it with the empty string
     to reset the defaults to nothing. -->
<mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />

<mntoptions deny="suid,dev" />
<mntoptions allow="*" />
<!--<mntoptions deny="*" />
-->
<mntoptions require="nosuid,nodev" />

<!-- requires ofl from hxtools to be present -->
<logout wait="0" hup="0" term="0" kill="0" />


		<!-- pam_mount parameters: Volume-related -->
<mkmountpoint enable="1" remove="true" />

<volume user="lux" fstype="smbfs" server="192.168.1.1" path="documentos" mountpoint="/home/lux/compart/" options="workgroup=WORKGROUP,nosuid,nodev" />

</pam_mount>

And my pam.d/login file:

#%PAM-1.0
auth		required	pam_securetty.so
auth		requisite	pam_nologin.so
auth		required	pam_unix.so nullok 
auth            optional        pam_mount.so debug
auth		required	pam_tally.so onerr=succeed file=/var/log/faillog
# use this to lockout accounts for 10 minutes after 3 failed attempts
#auth		required	pam_tally.so deny=2 unlock_time=600 onerr=succeed file=/var/log/faillog
account		required	pam_access.so
account		required	pam_time.so
account		required	pam_unix.so
#password	required	pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
#password	required	pam_unix.so sha512 shadow use_authtok
session		required	pam_unix.so
session		required	pam_env.so
session		required	pam_motd.so
session		required	pam_limits.so
session		optional	pam_mail.so dir=/var/spool/mail standard
session		optional	pam_lastlog.so
session		optional	pam_loginuid.so
-session	optional	pam_ck_connector.so nox11
-session	optional	pam_systemd.so

And some information about pam_mount debug with this comand:

 cat /var/log/auth.log | grep pam_mount

Result:

Mar  3 23:29:31 localhost login: (pam_mount.c:365): pam_mount 2.13: entering auth stage
Mar  3 23:32:12 localhost login: (pam_mount.c:133): clean system authtok=0xf73c10 (0)
Mar  3 23:32:17 localhost login: (pam_mount.c:365): pam_mount 2.13: entering auth stage
Mar  3 23:35:22 localhost login: (pam_mount.c:133): clean system authtok=0x14a6d90 (0)
Mar  3 23:35:26 localhost login: (pam_mount.c:365): pam_mount 2.13: entering auth stage
Mar  3 23:38:02 localhost login: (pam_mount.c:133): clean system authtok=0x1c780a0 (0)
Mar  3 23:38:06 localhost login: (pam_mount.c:365): pam_mount 2.13: entering auth stage

Does anyone experienced this problem?
Thanks in advance

Offline

Board footer

Powered by FluxBB