florpc
September 28th, 2009, 12:54 PM
Hi guys,
As a little project for school I've set up a Windows Server 2008 R2 server with AD installed, an Ubuntu 9.04 Server and Windows XP clients in a "lab environment".
I installed the packages:
apt-get install squid samba ntp bind9 winbind krb5-user krb5-config
/etc/network/interfaces
auto lo
iface lo inet loopback
auto eth2
iface eth2 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.0.50
netmask 255.255.255.0
gateway 192.168.0.50
dns-search davinci.local
dns-nameservers 192.168.0.50 83.143.245.36
/etc/hosts
127.0.0.1 localhost
127.0.1.1 srv1
192.168.0.50 srv1 srv1.davinci.local
192.168.0.51 dc1 dc1.davinci.local
My firewall script loaded through rc.local:
iptables -F
iptables -t nat -F
iptables --delete-chain
iptables --table nat --delete-chain
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -m state --state INVALID -j DROP
iptables -A FORWARD -m state --state INVALID -j DROP
iptables -A OUTPUT -m state --state INVALID -j DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A FORWARD -i eth1 -o eth2 -j ACCEPT
iptables -A FORWARD -i eth2 -o eth1 -j ACCEPT
iptables -A INPUT -i eth1 -j ACCEPT
iptables -A INPUT -i eth2 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE
My internal interface is eth1. And eth2 connects to the modem.
Ofcourse, IPv4 forwarding is enabled.
I editted the squid.conf file:
# OPTIONS FOR AUTHENTICATION
# Active Directory configuration
auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp --requiremembership-of=DAVINCI.LOCAL+Internet
auth_param ntlm children 30
auth_param ntlm keep_alive on
(...)
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
acl our_networks src 192.168.0.0/24
acl to_webserver dst 192.168.0.50
acl good url_regex "/home/samba/writable/admin/data/squid-allow.acl"
acl bad url_regex "/home/samba/writable/admin/data/squid-block.acl"
acl ad_users proxy_auth REQUIRED
http_access deny bad
http_access allow to_webserver
http_access allow good
http_access allow localhost
http_access allow ad_users
http_access deny al
(...)
cache_effective_user proxy
cache_effective_group squid
I've alse set permissions:
groupadd squid
chown proxy:squid /var/run/samba/winbindd_privileged
chmod 750 /var/run/samba/winbindd_privileged
/etc/samba/smb.conf
[global]
netbios name = srv1
realm =DAVINCI.LOCAL
workgroup = DAVINCI
security = ADS
#security = user
password server = dc1.davinci.local
socket options = TCP_NODELAY SO_RCVBUF=16384 SO_SNDBUF=16384
idmap uid = 10000-20000
winbind enum users = yes
winbind uid = 10000-20000
winbind gid = 10000-20000
winbind separator = +
winbind use default domain = yes
encrypt passwords = yes
log level = 3 passdb:5 auth:10 winbind:5
/etc/krb5.conf
[libdefaults]
ticket_lifetime = 600
default_realm = DAVINCI.LOCAL
dns_lookup_realm = false
dns_lookup_kdc = false
[realms]
DAVINCI.LOCAL = {
kdc = dc1.davinci.local:88
admin_server = dc1.davinci.local:749
default_domain = DAVINCI.LOCAL
}
[domain_realm]
.davinci.local = dc1.davinci.local
davinci.local = dc1.davinci.local
[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
Joining the domain... DNS updates failed??
net ads join -U Administrator -S dc1.davinci.local
Enter Administrator's password:
Using short domain name -- DAVINCI
Joined 'SRV1' to realm 'davinci.local'
[2009/09/28 18:50:18, 0] utils/net_ads.c:net_update_dns_internal(1064)
net_update_dns_internal: Failed to connect to our DC!
DNS update failed!
wbinfo -t
checking the trust secret via RPC calls succeeded
wbinfo -u
[...]
Administrator
TestUser
But the test for the helper-protcol failed:
ntlm_auth --helper-protocol=squid-2.5-basic
DAVINCI.LOCAL+testUser testPassword159
[2009/09/28 18:45:49, 3] utils/ntlm_auth.c:check_plaintext_auth(328)
NT_STATUS_PIPE_DISCONNECTED: Named pipe dicconnected (0xc00000b0)
ERR
I really don't have much Ubuntu/Linux experience, but I'm trying to get this working for days.
Any suggestions? Thanks!
As a little project for school I've set up a Windows Server 2008 R2 server with AD installed, an Ubuntu 9.04 Server and Windows XP clients in a "lab environment".
I installed the packages:
apt-get install squid samba ntp bind9 winbind krb5-user krb5-config
/etc/network/interfaces
auto lo
iface lo inet loopback
auto eth2
iface eth2 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.0.50
netmask 255.255.255.0
gateway 192.168.0.50
dns-search davinci.local
dns-nameservers 192.168.0.50 83.143.245.36
/etc/hosts
127.0.0.1 localhost
127.0.1.1 srv1
192.168.0.50 srv1 srv1.davinci.local
192.168.0.51 dc1 dc1.davinci.local
My firewall script loaded through rc.local:
iptables -F
iptables -t nat -F
iptables --delete-chain
iptables --table nat --delete-chain
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -m state --state INVALID -j DROP
iptables -A FORWARD -m state --state INVALID -j DROP
iptables -A OUTPUT -m state --state INVALID -j DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A FORWARD -i eth1 -o eth2 -j ACCEPT
iptables -A FORWARD -i eth2 -o eth1 -j ACCEPT
iptables -A INPUT -i eth1 -j ACCEPT
iptables -A INPUT -i eth2 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE
My internal interface is eth1. And eth2 connects to the modem.
Ofcourse, IPv4 forwarding is enabled.
I editted the squid.conf file:
# OPTIONS FOR AUTHENTICATION
# Active Directory configuration
auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp --requiremembership-of=DAVINCI.LOCAL+Internet
auth_param ntlm children 30
auth_param ntlm keep_alive on
(...)
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
acl our_networks src 192.168.0.0/24
acl to_webserver dst 192.168.0.50
acl good url_regex "/home/samba/writable/admin/data/squid-allow.acl"
acl bad url_regex "/home/samba/writable/admin/data/squid-block.acl"
acl ad_users proxy_auth REQUIRED
http_access deny bad
http_access allow to_webserver
http_access allow good
http_access allow localhost
http_access allow ad_users
http_access deny al
(...)
cache_effective_user proxy
cache_effective_group squid
I've alse set permissions:
groupadd squid
chown proxy:squid /var/run/samba/winbindd_privileged
chmod 750 /var/run/samba/winbindd_privileged
/etc/samba/smb.conf
[global]
netbios name = srv1
realm =DAVINCI.LOCAL
workgroup = DAVINCI
security = ADS
#security = user
password server = dc1.davinci.local
socket options = TCP_NODELAY SO_RCVBUF=16384 SO_SNDBUF=16384
idmap uid = 10000-20000
winbind enum users = yes
winbind uid = 10000-20000
winbind gid = 10000-20000
winbind separator = +
winbind use default domain = yes
encrypt passwords = yes
log level = 3 passdb:5 auth:10 winbind:5
/etc/krb5.conf
[libdefaults]
ticket_lifetime = 600
default_realm = DAVINCI.LOCAL
dns_lookup_realm = false
dns_lookup_kdc = false
[realms]
DAVINCI.LOCAL = {
kdc = dc1.davinci.local:88
admin_server = dc1.davinci.local:749
default_domain = DAVINCI.LOCAL
}
[domain_realm]
.davinci.local = dc1.davinci.local
davinci.local = dc1.davinci.local
[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
Joining the domain... DNS updates failed??
net ads join -U Administrator -S dc1.davinci.local
Enter Administrator's password:
Using short domain name -- DAVINCI
Joined 'SRV1' to realm 'davinci.local'
[2009/09/28 18:50:18, 0] utils/net_ads.c:net_update_dns_internal(1064)
net_update_dns_internal: Failed to connect to our DC!
DNS update failed!
wbinfo -t
checking the trust secret via RPC calls succeeded
wbinfo -u
[...]
Administrator
TestUser
But the test for the helper-protcol failed:
ntlm_auth --helper-protocol=squid-2.5-basic
DAVINCI.LOCAL+testUser testPassword159
[2009/09/28 18:45:49, 3] utils/ntlm_auth.c:check_plaintext_auth(328)
NT_STATUS_PIPE_DISCONNECTED: Named pipe dicconnected (0xc00000b0)
ERR
I really don't have much Ubuntu/Linux experience, but I'm trying to get this working for days.
Any suggestions? Thanks!