Hah, thanks for your instructions they yielded results. For each of these tests I did the following.
* Reconfigured `pam-auth-update`
* I set `obey pam restrictions = Yes`
* Rebooted
* Checked whether the issue was reproducible
* service restart smbd
* check whether $HOME was still mounted
* Repeat
===============================================
Settings in pam-auth-update
[*] Unix authentication
[ ] Register user sessions in the systemd control group hierarchy
[ ] Create home directory on login
[ ] eCryptfs Key/Mount Management
[ ] Inheritable Capabilities Management
Restarted smbd and observed the log entry:
# tail -F /var/log/auth.log|rg samba:session
Sep 12 22:15:08 machine smbd[1839]: pam_unix(samba:session): session closed for user johndoe
$HOME was still available.
===============================================
Settings in pam-auth-update
[*] Unix authentication
[ ] Register user sessions in the systemd control group hierarchy
[ ] Create home directory on login
[ ] eCryptfs Key/Mount Management
[*] Inheritable Capabilities Management
Restarted smbd and observed the log entry:
# tail -F /var/log/auth.log|rg samba:session
Sep 12 22:24:27 machine smbd[1844]: pam_unix(samba:session): session closed for user johndoe
$HOME was still available.
===============================================
Settings in pam-auth-update
[*] Unix authentication
[ ] Register user sessions in the systemd control group hierarchy
[ ] Create home directory on login
[*] eCryptfs Key/Mount Management
[*] Inheritable Capabilities Management
Restarted smbd and observed the log entry:
# tail -F /var/log/auth.log|rg samba:session
Sep 12 22:27:31 machine smbd[1861]: pam_unix(samba:session): session closed for user johndoe
$HOME was unmounted!!!
===============================================
Settings in pam-auth-update
[*] Unix authentication
[ ] Register user sessions in the systemd control group hierarchy
[ ] Create home directory on login
[*] eCryptfs Key/Mount Management
[*] Inheritable Capabilities Management
Restarted smbd and observed the log entry:
# tail -F /var/log/auth.log|rg samba:session
Sep 12 22:32:57 machine smbd[1857]: pam_unix(samba:session): session closed for user johndoe
$HOME was unmounted!!!
===============================================
So, to summarize: the setting "eCryptfs Key/Mount Management" from pam-auth-update is what causes the behavior. So I guess this isn't related to Samba, but I would still consider this defective behavior nevertheless.
But honestly even if you close this and never did anything about it it would still help someone encountering this in future because of the search results.
Hah, thanks for your instructions they yielded results. For each of these tests I did the following.
* Reconfigured `pam-auth-update`
* I set `obey pam restrictions = Yes`
* Rebooted
* Checked whether the issue was reproducible
* service restart smbd
* check whether $HOME was still mounted
* Repeat
======= ======= ======= ======= ======= ======= =====
Settings in pam-auth-update
[*] Unix authentication
[ ] Register user sessions in the systemd control group hierarchy
[ ] Create home directory on login
[ ] eCryptfs Key/Mount Management
[ ] Inheritable Capabilities Management
Restarted smbd and observed the log entry:
# tail -F /var/log/ auth.log| rg samba:session samba:session) : session closed for user johndoe
Sep 12 22:15:08 machine smbd[1839]: pam_unix(
$HOME was still available.
======= ======= ======= ======= ======= ======= =====
Settings in pam-auth-update
[*] Unix authentication
[ ] Register user sessions in the systemd control group hierarchy
[ ] Create home directory on login
[ ] eCryptfs Key/Mount Management
[*] Inheritable Capabilities Management
Restarted smbd and observed the log entry:
# tail -F /var/log/ auth.log| rg samba:session samba:session) : session closed for user johndoe
Sep 12 22:24:27 machine smbd[1844]: pam_unix(
$HOME was still available.
======= ======= ======= ======= ======= ======= =====
Settings in pam-auth-update
[*] Unix authentication
[ ] Register user sessions in the systemd control group hierarchy
[ ] Create home directory on login
[*] eCryptfs Key/Mount Management
[*] Inheritable Capabilities Management
Restarted smbd and observed the log entry:
# tail -F /var/log/ auth.log| rg samba:session samba:session) : session closed for user johndoe
Sep 12 22:27:31 machine smbd[1861]: pam_unix(
$HOME was unmounted!!!
======= ======= ======= ======= ======= ======= =====
Settings in pam-auth-update
[*] Unix authentication
[ ] Register user sessions in the systemd control group hierarchy
[ ] Create home directory on login
[*] eCryptfs Key/Mount Management
[*] Inheritable Capabilities Management
Restarted smbd and observed the log entry:
# tail -F /var/log/ auth.log| rg samba:session samba:session) : session closed for user johndoe
Sep 12 22:32:57 machine smbd[1857]: pam_unix(
$HOME was unmounted!!!
======= ======= ======= ======= ======= ======= =====
So, to summarize: the setting "eCryptfs Key/Mount Management" from pam-auth-update is what causes the behavior. So I guess this isn't related to Samba, but I would still consider this defective behavior nevertheless.
But honestly even if you close this and never did anything about it it would still help someone encountering this in future because of the search results.