12

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?

4 Answers 4

7

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.

map to guest = bad user

"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).

usershare allow guests = no

After updating /etc/samba/smb.conf and starting the service, samba clients are able to access the shared folder.

service smbd status

Starting Samba SMB Daemon...
Started Samba SMB Daemon.
pam_unix(samba:session): session opened for user (username) by (uid=0)
pam_unix(samba:session): session closed for user (username)
pam_unix(samba:session): session opened for user (username) by (uid=0)
pam_unix(samba:session): session opened for user (username) by (uid=0)
pam_unix(samba:session): session closed for user (username)

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:

The nobody user is used when you try to access to a share as a guest. Since you didn’t set a Samba password for your user, each time you tried to authenticate as your user, it failed and fell back on a guest access instead.

1
  • 1
    Thanks, i was looking for an solution for hours. After i created a Samba user similar to my Windows user it directly worked. I don't understand why i don't het prompted when no user similar to my Windows user exists. I would expect that it will ask for the username and password in that case.
    – CodeNinja
    Jan 5, 2022 at 8:05
4

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:

nobody is a system user that is used to run services e.g. apache and samba on Linux distros. Root has to start the service and then pass on control to the user nobody.

0

You have created a shared folder owned by "nobody/nogroup"

sudo chown -R nobody.nogroup /path_to_share/share_folder

But, you can change that, by changing ownership

sudo chown -R root.root /path_to_share/share_folder
sudo chown -R user.user /path_to_share/share_folder # "user" is echo $USER
0

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à.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .