Mountages automatiques sur une Kubuntu22 via pam_mount Sue Kubuntu 22 (= KDE) le programme de connexion est “SDDM”.

Paquets

$ sudo apt-get install libpam-mount cifs-utils samba-common smbclient

Ne pas remémarrer avant d'avoir fait la config!

Config

$ sudo mkdir /media/OMV
$ sudo chmod -R 777 /media/OMV

$ sudo nano /etc/pam.d/common-pammount-AG et entrer
auth optional pam_mount.so use_first_pass
session optional pam_mount.so

$ sudo nano /etc/pam.d/sddm et entrer à la fin:
@include common-pammount-AG

$ sudo nano /etc/pam.d/sddm-autologin et entrer à la fin:
@include common-pammount-AG

Partages

$ sudo nano /etc/security/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="0" />
<!-- Volume definitions -->
<!-- pour OpenMediaVault -->
<volume fstype="cifs"
server="machine.guedel.eu"
path="Home_%(DOMAIN_USER)"
mountpoint="/media/machine/home_%(DOMAIN_USER)"
user="*"
options="rw,auto,iocharset=utf8"
uid="900-999999999" />
-->
<!-- 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="no" term="no" kill="no" />
<!-- pam_mount parameters: Volume-related -->
<mkmountpoint enable="1" remove="true" />
</pam_mount>

Dépannage