Archive for the 'Windows' Category

Integrating Squid with Active Directory

Recently I needed to integrate a Squid Proxy server in an Active Directory environment. The main objective was to grant / deny access to the Internet by user / group validation, using single sign on.

The solution might not be the most elegant, but it’s a working one. You’ll need to install the Kerberos, Samba, Squid and NTP packages.

In this solution will be allowing all users in the InternetOn AD group to have access automatically. Any users outside this group will be denied access. Computers outside the AD trying to use the proxy will be prompt for username and password.

krb5.conf

[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
default_realm = YOURDOMAIN
dns_lookup_realm = false
dns_lookup_kdc = false
ticket_lifetime = 24h
forwardable = yes
[realms]
YOURDOMAIN = {
kdc = yourpdc
admin_server = yourpdc
default_domain = YOURDOMAIN
kpasswd_server = yourpdc
}
[domain_realm]
.yourdomain = yourdomain
[kdc]
profile = /var/kerberos/krb5kdc/kdc.conf
[appdefaults]
pam = {
debug = false
ticket_lifetime = 36000
renew_lifetime = 36000
forwardable = true
krb4_convert = false
}

#####################################################

smb.conf

[global]
workgroup = YOURDOMAIN
server string = SQUIDPROXY (or any other name you want)
security = ADS
auth methods = winbind
encrypt passwords = yes
idmap uid = 70001-90000
winbind enum users = yes
winbind gid = 70001-90000
winbind enum groups = yes
client use spnego = yes
winbind separator = \\
load printers = yes
cups options = raw
log file = /var/log/samba/%m.log
max log size = 50
password server = yourpdcIP
realm = YOURDOMAIN
dns proxy = no
[homes]
comment = Home Directories
browseable = no
writable = yes

[printers]
comment = All Printers
path = /usr/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes

#####################################################

squid.conf

http_port 8080
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
access_log /var/log/squid/access.log squid
emulate_httpd_log on
auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp
auth_param ntlm children 5
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-caching web server
auth_param basic credentialsttl 2 hours
external_acl_type ADS %LOGIN /usr/lib/squid/wbinfo_group.pl
acl interneton external ADS InternetOn

acl blocksites url_regex "/etc/squid/squid-block.acl"
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 SSL_ports port 443 563 # https, snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # waisacl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
acl AuthorizedUsers proxy_auth REQUIRED
http_access deny blocksites
http_access allow interneton
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
http_access allow localhost
http_access deny all
http_reply_access allow all
icp_access allow all
coredump_dir /var/spool/squid

#####################################################

Start samba, winbind and squid by this order.

Synchronize your squid server with the AD

ntpdate yourprimarydomaincontroller

Initialise Kerberos

kinit administrator@YOURDOMAIN

Test Kerberos connection

klist

Join Squid Server to AD

net ads join -S yourpdc -U administrator

Validate Trust

wbinfo -t

Validate if the wbinfo_group.pl script is working

echo "youralloweduser InternetOn" | /usr/lib/squid/wbinfo_group.pl -d
(it returns OK or ERR if the user is in the InternetOn group or not)

You might have some problems with the winbindd_privileged directory. If that’s the case:

cd /var/cache/samba
chgrp squid winbindd_privileged
chmod 750 winbindd_privileged

The problem with this setup is that when you change the InternetOn members, Samba / Winbind aren’t aware of the change until the cache clears, so I made a small script you can run in cron or manually.

clearcache.sh

#!/bin/bash
/etc/init.d/smb stop
/etc/init.d/winbind stop
rm -f /var/cache/samba/*.tdb
/etc/init.d/smb start
/etc/init.d/winbind start
/etc/init.d/squid reload

Test this at your own risk. :)

Asus EEE PC 1008 HA SeaShell

Asus EEE PC 1008HA

Until a few weeks ago, the netbook market / scene was a bit of a unknown thing to me. I lacked the information mainly because I was never attracted to small notebooks and netbooks felt into that “class”.

What made me change my mind? Well, my wife often mentioned she would like to have a smaller notebook than her 15.4″ Dell to take to school. That and a trip we made this vacation :) I needed to take a computer and my 17″ Macbook Pro was out of the question since I would need it to check maps, info and e-mail on the go. So, a few days before this trip we went to take a look on the local Vobis / Worten and evaluated the offer.

The Asus EEE PC 1008HA was indeed the most balanced of them all, taking in perspective what we both needed: a light netbook. I was still split between the Asus and an Aspire One, but the Asus had Wifi N and a bigger hard drive, not to mention the screen quality that is amazing.

But enought chit chat, here’s my take and notes on the Asus 1008HA:

Pros

  • Very light, only weights 1.1 Kg
  • Stylish design, similar to a MacBook Air
  • 160Gb HD
  • WiFi Draft N and Bluetooth v2.1
  • Functional Keyboard
  • Multitouch Touchpad
  • 6 hours unplugged computing with Super Hybrid Engine (Asus’s energy managment app)

Cons

  • Plastic sheel feels cheap and fragile in some areas
  • Windows XP bundle
  • Non Removable Battery
  • No easy access to RAM and HD
  • 1.1 Mpixel Webcam has a crappy framerate

The Netbook behaved very well on the go, the battery time is amazing and it seems to last forever, and it’s a good thing because there’s no way to use a second battery. Due to the Seashell design, Asus limited all the expansion on the machine. The battery is not user removable neither is the RAM or HD. To replace these three components you need to disassemble the machine.

One of my frustrations was that there was no bundle with Linux, Asus seems to be kissing Microsoft’s ass again with Netbooks, so the first thing I did after getting home from the trip was to try to find a decent operating system for the Netbook. The candidates were:

  1. Windows 7
  2. Fedora 11
  3. Jolicloud
  4. Ubuntu Netbook Remix

Windows 7 installed very well, the only problem I had was with the ACPI and graphics card. Flashing the 1008HA with the latest bios solved the latest problem, and the other one was solved with a hacked ACPI driver I found on the web. There are still no Asus drivers for Windows 7 but the ones the system installs work rather well. The problem with 7 is that with a default configuration it ran slower than XP, consuming a hefty 450Mb of RAM without no other application loaded. Oh and it was slow as hell to boot. So, on to the next.

Fedora 11 looked beautiful for the first 5 minutes. It all seemed to work out of the box, even wireless and it booted rather fast from the CD I was using. One of the first problems I noticed was that the it wasn’t optimized for netbooks, Gnome dialog boxes were huge and often the OK / Cancel buttons were offscreen. When I tried to install it to the hard drive it failed afer creating the partitions and exited the installation program, leaving me with a damaged installation. I might try it another time but for now… next!

I was very eager to try Jolicloud but the alpha is still invitation only, and since no one on the Interwebs was kind enought to send me an invite, I only managed to try the OS without the cloud part… It seemed like a heavily modified Ubuntu Netbook Remix. It worked very well out of the box and the eye candy is very cool. Sadly for me the most interesting part of this system is the cloud… so, on to the next one.

Enter Ubuntu Netbook Remix, a netbook oriented Ubuntu, which seems to be the most common base of a boatload of netbook linux distros. I installed UNR 9.04 and guess what? Wireless and Ethernet didn’t work. It was Google time and I finally found this guy’s post on the 1008HA and exactly the same problem I had. Three commands and a reboot and Networking is back, my luck is that I also had an USB Ethernet adpter that UNR immediately recognized. After taking it for a quick spin, it seems I found a suitable OS for this netbook.

Of couse I’m not stoping here, as I’m writing this I’m installing UNR 9.10 Alpha to check if there are some significant improvements over 9.04. After that I’ll probably try another 2 or 3 distros, but I think it will be hard to surpass UNR 9.04. Unfortunately not everything works with UNR as well as it works with Windows XP, since there are no Asus drivers for Linux either. So don’t count with some keyboard combos and the Super Hybrid Engine on Linux, at least for now.

Ending this loooong post: The more I play with this netbook the more I wish that Apple would release a netbook or a smaller version of the Air (still I wouldn’t mind having an Air). I think that once you go Mac it’s hard to look back.

Notes

To get wireless working on UNR 9.04:

sudo apt-get update

Reboot

then:

sudo apt-get upgrade

Reboot

sudo apt-get install linux-backports-modules-jaunty

Reboot only needed after modules installation. (Thanks Tiago!)

There’s a big step…

…between saying and actually doing it…. time will tell.

[tags]Microsoft[/tags]

Microsoft’s new Linux Bashing Site

As if the famous “Get the Facts” website wasn’t completely stupid and biased, MS presents us with another Linux Hate website, this time called WindowsServer/Compare.

In this new site, MS mainly compares the Windows Server Platform to Linux, Unix and Mainframe environments as well as providing some case studies… it’s “Get the Facts” part 2, but this time they have use Novell (their partners) as a comparing term… the “middle guy”, the “not so bad Linux” because the main target is definitely Red Hat. A site to see and read, even that is just for the laughs.

[tags]Microsoft, Linux, Novell, Red Hat, Windows Server[/tags]

Rotten Apple

Some times old habits can’t die… the main reason they get old is probably because they are good habits in the first place. I just got home from a friends birthday dinner, we spend some time in his office because he wanted to show me his new PC running Windows Vista Ultimate. This was my first Wow experience, Microsoft really did good this time. Everything in Vista is so fluid, so well designed, the improvements over XP are amazing. I just regret having this Macbook Pro now when I could have a superior PC running Vista… looks like this is the time to finally format my Mac, and install Boot Camp with Vista on it. Screw Mac OS X, I want the bubbles screensaver now!

[tags]Microsoft, Windows, Windows Vista, April Fools[/tags]

Disciplining

  1. Organize 100 GB of stuff cluttering my HD
  2. Delete e-junk in order to raise some space
  3. Backup my entire data
  4. Delete Windows XP Partition
  5. Re-Partition HDs
  6. Install Windows XP, install drivers, run Windows Update, install antivirus and firewall, install Firefox
  7. Don’t touch Windows ’till Xmas
  8. Install Ubuntu
  9. Install Automatix
  10. Install XGL and Compiz
  11. Configure Evolution
  12. Tweak Gnome
  13. Enjoy

[tags]Linux, Windows, Ubuntu[/tags]

Still on Origami

Microsoft Channel 9 has this nice interview of Otto Berkes the architect (now general manager) behind the Ultra-Mobile PC / Origami Project, where some adicional info on the project is revealed.

[tags]Origami, Microsoft, UMPC, Ultra-Mobile PC[/tags]

Microsoft Unfolds Origami

Microsoft Website has been updated with new info on the Origami Project.

Origami is not a single device but an architecture (UMPC) that brands like Asus and Samsung will use to build compliant devices. The Ultra-Mobile PC (UMPC) uses the Windows XP Tablet PC Edition 2005 OS and besides the standard features implied in the architecture the devices will have other features (like camaras) depending on the device maker.

The standard device specification:

  • Windows XP Tablet PC Edition 2005 OS
  • Approximately 7” diagonal display (or smaller)
  • Minimum 800 x 480 resolution
  • Approximately 2 pounds
  • Integrated touch panel
  • WiFi- and Bluetooth-enabled

The Origami devices will feature full Windows software support, multimedia and connectivity capabilities. I couldn’t find no info on the storage capabilities of the devices, not even on the Intel UMPC site.

Microsoft’s is giving another run on their Windows XP Tablet PC Edition, still it might be better than the Windows Mobile OS that’s being used on smartphones… Anyway, the project is looking good, now let’s wait for the prices.

[tags]Microsoft, Intel, Origami, UMPC, Windows XP Tablet PC Edition, Windows Mobile OS, Ultra-Mobile PC[/tags]

Microsoft Origami Revealed

I just have a question: Why there’s no camera included?

(If you’re reading this post in Planeta Asterisco, you won’t be able to see the video embeded)

[tags]Microsoft, Project Origami, Origami[/tags]

Catching up on Sunday

Well, after being 2 days far from tech world, I see I have to catch up on some news.
So far being worth of further reading for the next days:

  • Google’s take on online payments. Google might was well be PayPal’s next competition in the near future.
  • Microsoft’s Origami Project is buzzing the net, but all the hype is just about a few photos of what looks like a portable media player device / tablet pocket pc.
  • The 28th is approaching, and the Mac hype is growing more each day, but here’s something that might cool off the rumors.

[tags]Google, Microsoft, Project Origami, Mac, Apple, Hype[/tags]