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:
TIMESTAMP username@DOMAIN SUCCESS/FAILURE

link|improve this question

71% accept rate
feedback

3 Answers

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.

link|improve this answer
feedback

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: http://www.windowsecurity.com/articles/windows-active-directory-auditing.html

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

link|improve this answer
feedback

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
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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