I've set up an Ubuntu 14.04 server, using Samba to share files to our Windows clients. Everything appears to be working correctly, but while checking my auth logs, I see the line 'session closed for user nobody' repeated many many times, though no sessions opened for that user. All of the session opened messages have the correct user name included.
I understand the role of the nobody user, but am unsure why Samba keeps generating this message. On one line the 'session closed' message is repeated 58 times with no other auth log messages interrupting.
Is it likely that Samba is incorrectly configured?
I'm happy to post any logs/confs/outputs necessary, if that helps.
EDIT:
I've previously disabled Samba password sync using pam-auth-update
to stop the 'No Talloc Stackframe' message, like so, could that be generating all of these session closed messages?
I had this concern myself so I did some digging and ran into a lot of unanswered forum questions, but then I found this answer:
The same issue happened to me, at that time I failed to access the shared folder from Windows (by adding the location and access it without configuring the credential on Windows first) and commenting the following line in /etc/samba/smb.conf worked for me.
"pam_unix(samba:session): session closed for user nobody" appeared right after trying to access the share folder from Windows or other clients. It seems Windows client tries to contact samba as guest (not verified) especially when no credential is configured in the credential manager.
You may also need to change the following if you do not need guest accessing (default = yes).
After updating /etc/samba/smb.conf and starting the service, samba clients are able to access the shared folder.
Whether this works may depend on the samba version, the issue happened on a machine with samba 4.9.5, but no issue happened on my another machine where samba has version 4.7.6.
According to this page:
You have created a shared folder owned by "nobody/nogroup"
But, you can change that, by changing ownership
I was facing the same issue. I was sharing a folder inside the web apps in tomcat9. Well, I tried with a folder in the home directory, and voilà.