Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have users authenticating with squid (NTLM) to an Active Directory server using Samba 3.5.4 and I'd like to log users' login attempts.

I'd like a line showing something like:

share|improve this question

If you modify the log level line in /etc/samba/smb.conf to read:

log level: log level = 1 winbind:5

You do get the information I'm after (by default logged to /var/log/samba/log.DOMAIN), but it's very noisy and the log messages are split over two lines. Not exactly what I'm looking for but it might have to do.

share|improve this answer
I'm not too sure why you put "log level: " at the beginning. Works a lot better without it! Also, on my end I was trying to understand why a log in failed and I used: log level = 10 all:10 to really get all the info. The manual page also lists all the other capabilities such as windbind and passwd. – Alexis Wilke Mar 8 '13 at 4:25

On the samba log files, authentication-related information is tagged with the check_ntlm_password module (assuming that's what you are using). If you want date and hour, you have to capture the line before the one with actual information.

Here are some examples. The name of the user was replaced with xxx.yyy in all cases. Note how the capitalization for authentication is different for success and failure cases.

[2011/11/08 10:22:40.604819,  2] auth/auth.c:304(check_ntlm_password)
  check_ntlm_password:  authentication for user [xxx.yyy] -> [xxx.yyy] -> [xxx.yyy] succeeded

[2012/01/11 09:09:00.430424,  2] auth/auth.c:314(check_ntlm_password)
  check_ntlm_password:  Authentication for user [xxx.yyy] -> [xxx.yyy] FAILED with error NT_STATUS_WRONG_PASSWORD

There are other messages beyond these two. These lines were produced by a Samba from the backports repository of lenny. The samba version is 3.5.6, the actual package version is 2:3.5.6~dfsg-3~bpo50+1. The exact configuration for logging on smb.conf was:

syslog = 0
debug level = 2
log file = /var/log/samba/%m.log
max log size = 1024
panic action = /usr/share/samba/panic-action %d
share|improve this answer

if you're hitting AD, then you should see the logon attempts in the "security log". It should contain not only the username, but also the source IP (which should be your squid host).

Here's a good article on setting it up:

I would caution on auditing success though, as it tends to fill up the logs fast.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.