LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-11-2006, 03:43 AM   #1
rowellb
LQ Newbie
 
Registered: Jun 2006
Location: UK
Distribution: Ubuntu 6.06
Posts: 10

Rep: Reputation: 0
SQUID NTLM Authentication keeps asking for a username and password


Hi,

I have a SQUID proxy server setup using ntlm authentication and dansguadian to log users that try to view inappropriate material in my school. Everything is working fine except everytime a user launches internet explorer it asks the user for their username and password. Is it possible to maintain the authentication but not have the user prompted for their username and password?
 
Old 07-11-2006, 06:30 AM   #2
~=gr3p=~
Member
 
Registered: Feb 2005
Location: ~h3av3n~
Distribution: RHEL 4, Fedora Core 3,6,7 Centos 5, Ubuntu 7.04
Posts: 227

Rep: Reputation: 30
show me ur squid.conf

NTLM authentication reads the currently logged in domain users credentials and won't prompt for password unless it has expired.

btw I hope u use Active Direcotry ?
 
Old 07-12-2006, 03:02 AM   #3
rowellb
LQ Newbie
 
Registered: Jun 2006
Location: UK
Distribution: Ubuntu 6.06
Posts: 10

Original Poster
Rep: Reputation: 0
squid.conf

Hi, yes I am using Windows Server 2003 and AD. Here's the squid.conf file:

auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp
auth_param ntlm children 30
auth_param ntlm max_challenge_reuses 0
auth_param ntlm max_challenge_lifetime 2 minutes
auth_param ntlm use_ntlm_negotiate on
auth_param basic program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic
auth_param basic children 5
auth_param basic realm Squid Proxy Server
auth_param basic credentialsttl 2 hours
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
hosts_file /etc/hosts
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
acl authenticated_users proxy_auth REQUIRED
acl lan src 10.248.96.1-10.248.127.254
http_access allow authenticated_users
http_access allow localhost
http_access allow lan
http_access deny all
http_reply_access allow all
icp_access allow all
visible_hostname proxyserver
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
coredump_dir /var/spool/squid

(I've removed all the commented lines)

Cheers
 
Old 07-12-2006, 04:29 AM   #4
~=gr3p=~
Member
 
Registered: Feb 2005
Location: ~h3av3n~
Distribution: RHEL 4, Fedora Core 3,6,7 Centos 5, Ubuntu 7.04
Posts: 227

Rep: Reputation: 30
looks ok. to be more precise allow the acl this way:

http_access allow authenticated_users lan

Apart from above have u configured kerberos ldap client and Samba correctly. Can u show ldap samba and krb5 conf

Last edited by ~=gr3p=~; 07-12-2006 at 04:32 AM.
 
Old 07-12-2006, 05:55 AM   #5
rowellb
LQ Newbie
 
Registered: Jun 2006
Location: UK
Distribution: Ubuntu 6.06
Posts: 10

Original Poster
Rep: Reputation: 0
conf files

Here's the krb5.conf:
[libdefaults]
ticket_lifetime = 600
default_realm = CURRICULUM.COM
default_tkt_enctypes = des3-hmac-sha1 des-cbc-crc
default_tgs_enctypes = des3-hmac-sha1 des-cbc-crc
dns_lookup_realm = false
dns_lookup_kdc = false

[realms]
CURRICULUM.COM = {
kdc = 10.248.99.1:88
admin_server = 10.248.99.1:749
default_domain = CURRICULUM.COM
}

[domain_realm]
.curriculum.com = CURRICULUM.COM
curriculum.com = CURRICULUM.COM

[kdc]
profile = /etc/krb5kdc/kdc.conf

[logging]
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmin.log
default = FILE:/var/log/krb5lib.log

and the smb.conf:

[global]
workgroup = CURRICULUM
netbios name = proxyserver
realm = CURRICULUM.COM
server string = Linux Samba Server
security = ads
encrypt passwords = Yes
password server = 10.248.99.1
log file = /var/log/samba/%m.log
max log size = 0
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
preferred master = False
local master = No
domain master = False
dns proxy = No
wins server = 10.248.99.1
winbind separator = /
winbind enum users = yes
winbind enum groups = yes
winbind use default domain = yes
idmap uid = 10000-20000
idmap gid = 10000-20000

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
#workgroup = MSHOME

# server string is the equivalent of the NT Description field
server string = %h server (Samba, Ubuntu)

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
; wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no

# What naming service and in what order should we use to resolve host names
# to IP addresses
; name resolve order = lmhosts host wins bcast

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = true



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m

# Put a capping on the size of the log files (in Kb).
max log size = 1000

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
; syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html
# in the samba-doc package for details.
; security = user

# You may wish to use password encryption. See the section on
# 'encrypt passwords' in the smb.conf(5) manpage before enabling.
encrypt passwords = true

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.
passdb backend = tdbsam

obey pam restrictions = yes

; guest account = nobody
invalid users = root

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
; unix password sync = no

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
; pam password change = no

########## Domains ###########

# Is this machine able to authenticate users. Both PDC and BDC
# must have this setting enabled. If you are the BDC you must
# change the 'domain master' setting to no
#
; domain logons = yes
#
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of the user's profile directory
# from the client point of view)
# The following required a [profiles] share to be setup on the
# samba server (see below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
; logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
; logon drive = H:
; logon home = \\%N\%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
; logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

########## Printing ##########

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
; load printers = yes

# lpr(ng) printing. You may wish to override the location of the
# printcap file
; printing = bsd
; printcap name = /etc/printcap

# CUPS printing. See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
; printing = cups
; printcap name = cups

# When using [print$], root is implicitly a 'printer admin', but you can
# also give this right to other users to add drivers and set printer
# properties
; printer admin = @lpadmin


############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m

# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/speed.html
# for details
# You may want to add the following on a Linux system:
# SO_RCVBUF=8192 SO_SNDBUF=8192
socket options = TCP_NODELAY

# The following parameter is useful only if you have the linpopup package
# installed. The samba maintainer and the linpopup maintainer are
# working to ease installation and configuration of linpopup and samba.
; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

# Domain Master specifies Samba to be the Domain Master Browser. If this
# machine will be configured as a BDC (a secondary logon server), you
# must set this to 'no'; otherwise, the default behavior is recommended.
; domain master = auto

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash

#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
;[homes]
; comment = Home Directories
; browseable = no

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server. Un-comment the following parameter
# to make sure that only "username" can connect to \\server\username
; valid users = %S

# By default, the home directories are exported read-only. Change next
# parameter to 'yes' if you want to be able to write to them.
; writable = no

# File creation mask is set to 0600 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0664.
; create mask = 0600

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
; directory mask = 0700

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; writable = no
; share modes = no

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700

[printers]
comment = All Printers
browseable = no
path = /tmp
printable = yes
public = no
writable = no
create mode = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# Replace 'ntadmin' with the name of the group your admin users are
# members of.
; write list = root, @ntadmin

# A sample share for sharing your CD-ROM with others.
;[cdrom]
; comment = Samba server's CD-ROM
; writable = no
; locking = no
; path = /cdrom
; public = yes

# The next two parameters show how to auto-mount a CD-ROM when the
# cdrom share is accesed. For this to work /etc/fstab must contain
# an entry like this:
#
# /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0
#
# The CD-ROM gets unmounted automatically after the connection to the
#
# If you don't want to use auto-mounting/unmounting make sure the CD
# is mounted on /cdrom
#
; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom

Don't know where the ldap conf file is
Thanks.
 
Old 07-12-2006, 09:25 AM   #6
~=gr3p=~
Member
 
Registered: Feb 2005
Location: ~h3av3n~
Distribution: RHEL 4, Fedora Core 3,6,7 Centos 5, Ubuntu 7.04
Posts: 227

Rep: Reputation: 30
sorry ignore LDAP(by mistake)

1) backup ur krb5.conf and put only this:
Quote:
[libdefaults]
ticket_lifetime = 600
default_realm = CURRICULUM.COM

[realms]
CURRICULUM.COM = {
kdc = 10.248.99.1
admin_server = 10.248.99.1
default_domain = CURRICULUM.COM
}

[domain_realm]
.curriculum.com = CURRICULUM.COM
curriculum.com = CURRICULUM.COM

[kdc]
profile = /etc/krb5kdc/kdc.conf

[logging]
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmin.log
default = FILE:/var/log/krb5lib.log

[appdefaults]
pam = {
debug = false
ticket_lifetime = 36000
renew_lifetime = 36000
forwardable = true
krb4_convert = false
}
Also do:

echo ".curriculum.com curriculum.com" >> /etc/krb.realms


2) have u set your primary DNS -> 10.248.99.1 in /etc/resolv.conf

3) have u joined the linux box to your DC?

# kinit administrator@CURRICULUM.COM
# klist
# net join -S 10.248.99.1 -U administrator

4) Backup your smb.conf and put only this in it:
Quote:
[global]
workgroup = CURRICULUM
netbios name = proxyserver
realm = CURRICULUM.COM
server string = Linux Samba Server
security = ads
encrypt passwords = Yes
password server = 10.248.99.1
log file = /var/log/samba/%m.log
max log size = 0
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
preferred master = False
local master = No
domain master = False
dns proxy = No
winbind enum users = yes
winbind enum groups = yes
winbind use default domain = yes
idmap uid = 10000-20000
idmap gid = 10000-20000
realm = CURRICULUM.COM
# testparm -s /etc/samba/smb.conf

start smb, nmb and winbindd

on REdhat systems just do service smb start

confirm winbindd is running
# pgrep winbindd

5) Now do u see your AD users and groups?

# wbinfo -u
# wbinfo -g

6) Now does this work?

# ntlm_auth --username=<Any AD username>

u shuld get this output "NT_STATUS_OK: Success (0x0)"

If all is fine then your windows users should be able to surf without password prompt.

Note: If u have enabled the password expire policy on ur Domain Controller then a user will get a password prompt after his/her password expires. Changing the password shuld make it work again normally.

Last edited by ~=gr3p=~; 07-12-2006 at 09:31 AM.
 
Old 07-13-2006, 03:48 AM   #7
rowellb
LQ Newbie
 
Registered: Jun 2006
Location: UK
Distribution: Ubuntu 6.06
Posts: 10

Original Poster
Rep: Reputation: 0
still not working!!!

Ok, I've done everything as you suggest and tested with wbinfo -u (produces list of users) and wbinfo -g (produces list of groups) also with ntlm_auth and user which gives the message NT_STATUS_OK: Success (0x0). And thanks for all the effort you've put in btw. But it still keeps asking for username and password everytime i launch internet explorer. It's starting to get silly now!
 
Old 07-13-2006, 08:32 AM   #8
~=gr3p=~
Member
 
Registered: Feb 2005
Location: ~h3av3n~
Distribution: RHEL 4, Fedora Core 3,6,7 Centos 5, Ubuntu 7.04
Posts: 227

Rep: Reputation: 30
While a user is authenticating using Internet Explorer can u show the log of squid at that point?

vi /var/log/squid/access

Certain programs which have proxy support with authentication have problem with NTLM. IE and MSN messengers or to be precise M$ products work flawlessly though.
 
Old 07-14-2006, 02:46 AM   #9
rowellb
LQ Newbie
 
Registered: Jun 2006
Location: UK
Distribution: Ubuntu 6.06
Posts: 10

Original Poster
Rep: Reputation: 0
access.log

Here's the access.log file, the first line is before authentication the second line is after.

Quote:
1152863042.283 1 127.0.0.1 TCP_DENIED/407 1848 GET http://welcome.hp-ww.com/country/us/.../but_right.gif - NONE/- text/html
1152863110.079 274 127.0.0.1 TCP_MISS/200 1513 GET http://welcome.hp-ww.com/country/us/.../but_right.gif rowellb DIRECT/213.200.97.62 image/gif
Thanks.
 
Old 07-14-2006, 03:09 AM   #10
~=gr3p=~
Member
 
Registered: Feb 2005
Location: ~h3av3n~
Distribution: RHEL 4, Fedora Core 3,6,7 Centos 5, Ubuntu 7.04
Posts: 227

Rep: Reputation: 30
you will see 3-4 TCP_DENIED that is normal coz the way NTLM challenge works..but then u will see the AD user authenticated as in this case it ur username..but still u recieve the password prompt ??

strange..is the acount locked out or something? I'm out of ideas now ..bcoz the same setup is live in my company..thoguh we have Windows 2000 Server and not 2k3.
 
Old 07-14-2006, 03:21 AM   #11
rowellb
LQ Newbie
 
Registered: Jun 2006
Location: UK
Distribution: Ubuntu 6.06
Posts: 10

Original Poster
Rep: Reputation: 0
dansguardian

I'm pretty sure my account is not locked, and it does it no matter what account you use to authenticate. Could it be something to do with the way dansguardian is setup?
 
Old 07-14-2006, 04:31 AM   #12
~=gr3p=~
Member
 
Registered: Feb 2005
Location: ~h3av3n~
Distribution: RHEL 4, Fedora Core 3,6,7 Centos 5, Ubuntu 7.04
Posts: 227

Rep: Reputation: 30
Quote:
Originally Posted by rowellb
I'm pretty sure my account is not locked, and it does it no matter what account you use to authenticate. Could it be something to do with the way dansguardian is setup?
oh i c..dansguardian is also there.

what port does it run on ?

if say dans runs on : 3128
and squid runs on: 8080

what is the IP address of the proxy server?

In dansguradian.conf:

filterip = <proxy server IP Address>

# the port that DansGuardian listens to.
filterport = 3128

# the ip of the proxy (default is the loopback - i.e. this server)
proxyip = <proxy server IP Address>

# the port DansGuardian connects to proxy on
proxyport = 8080



the squid.conf shuld be edited this way:

acl authenticated_users proxy_auth REQUIRED
acl proxy_ip src <proxy server IP Address>
http_access allow authenticated_users proxy_ip

# squid -k reconfigure

now in your windows clients Internet Ezplorer change the proxy setting to point to <proxy server IP> : 3128

and lemme know.

Last edited by ~=gr3p=~; 07-14-2006 at 04:36 AM.
 
Old 07-14-2006, 05:00 AM   #13
rowellb
LQ Newbie
 
Registered: Jun 2006
Location: UK
Distribution: Ubuntu 6.06
Posts: 10

Original Poster
Rep: Reputation: 0
dans

The ports are the other way around ie: squid 3128 and dans 8080. The IP address of my proxyserver is 10.248.99.50

I tried the stuff u said, adding the acl and modifying the dans conf file. Guess what? It still asks for the password!!

Does it matter that the ports are the other way around?
 
Old 07-14-2006, 05:35 AM   #14
~=gr3p=~
Member
 
Registered: Feb 2005
Location: ~h3av3n~
Distribution: RHEL 4, Fedora Core 3,6,7 Centos 5, Ubuntu 7.04
Posts: 227

Rep: Reputation: 30
Quote:
Originally Posted by rowellb
Does it matter that the ports are the other way around?
no it doesn't matter. Sorry i'm out of ideas what cud be wrong. Might be something to do with Win 2k3 policies. there are lot of new policies in 2k3 comapred to 2k.

or final input to troubleshoot:

add this option in squid.conf:

debug_options ALL,1 33,2 28,9

and:
tail -f /var/log/squid/cache.log

to see how the acl are matched and if there is a problem.

Last edited by ~=gr3p=~; 07-14-2006 at 05:40 AM.
 
Old 11-28-2008, 06:02 AM   #15
Kunthar
LQ Newbie
 
Registered: Mar 2004
Posts: 2

Rep: Reputation: 0
Are you sure you can set squid transparent with AD?
I dont think so
You should define AD policy directed 3128 and all users should directed in IEto this address
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NTLM authentication. TheRealDeal Linux - Networking 4 10-12-2006 07:36 PM
Squid and NTLM Authentication codedv Linux - Networking 5 07-16-2006 03:46 AM
Proxy with NTLM Authentication in Console nemesys571 Slackware 3 04-01-2006 11:26 AM
Samba share authentication using logon username and password mikepengelly Linux - Software 0 08-31-2004 03:47 AM
IE password not saved for web site - NTLM/Squid?? percheron Linux - Networking 0 12-07-2003 11:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration