Archive for the 'Linux' 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!)

Google Chrome OS – Was I right or what?

Last year, when Google released Chrome I wrote this.

Some might say it was futurology, but I say it was the most logical step of evolution. The fact is, I think I was really close on Google’s plans for Chrome.

Testing MaemoWordPy…

…on a Nokia N810 Internet Tablet :D

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]

Moonshine

fedora.jpgWell, Fedora 7 (no Core this time) was finally released today, I’m burning the ISO as I type this and I’m going to install it on top of my Fedora 7 Test 4 installation, to see what’s new. For those who haven’t read about Moonshine (aka Fedora 7) check some of the features here.

Meanwhile, Fedora 8 is peeking ;)

[tags]Fedora, Linux, RedHat[/tags]

Clean Fedora Project

The Fedora Project Website shows a new clean face, probably anticipating the release of Fedora 7 today on May 31… (BTW I’m using the test 4 version :D ). Looking forward for this new release guys!

[tags]Fedora, Fedora Project[/tags]

Ubuntu / Dell

Dell released a post with more details on the recent Ubuntu support.

Not bad if I may say so… I was expecting Dell to provide a ‘fire and forget’ kind of support for Ubuntu PCs…

[tags]Dell, Ubuntu, Linux[/tags]

Synergizing my Setup

My desktop was cluttered with a second mouse and keyboard from my old pc desktop (now running Feisty) and I really needed the desk space, so I had to figure a way to control the linux pc from my Mac. At first I thought about VNC, but it was stupid since I had a monitor hooked up to the pc, so there was no need for this (and VNC performance is l4m3). After a googling for a while, I came across Synergy. Synergy allows you to control multiple computers (running distinct OSs) with only one keyboard and mouse. This was just what I needed, the Mac is my main computer and has the keyboard and mouse to control everything (Synergy host) and the pc will be my secondary machine (Synergy client).

The setup process is really simple, on your Mac get SynergyKM which is the Synergy application packed with an excellent GUI for controlling the whole process. After installing SyngeryKM, configure it on System Preferences, the process is very clear and the most tricky part is the “Server Configuration”. Just add the screens like you have on real life and give the screens the host names for each computer you’re running Synergy on.

On the Linux PC it’s also very easy: open the terminal window and type sudo apt-get install quicksynergy this will install Synergy and QuickSynergy, a GUI to Synergy on Gnome. My goal was to get rid of the extra keyboard and mouse on my desk so, nothing more than running Synergy when Gnome “boots”, so we have to change some files:

On the terminal window:

sudo gedit /etc/gdm/Init/Default

Add this code BEFORE the “sysmodmap=/etc/X11/Xmodmap” line:

SYNERGYC=`gdmwhich synergyc`
if [ x$SYNERGYC != x ] ; then
$SYNERGYC [address of Syngery server]
fi

Change the [address of Syngery server] by the servers IP (like 192.168.1.10)

This loads the Synergy client when GDM runs and shows the login window, the problem is that when you login it kills the Syngergy client, so we need to make it run again.

On the terminal window:

sudo gedit /etc/gdm/PreSession/Default

Add the this in the middle of the file BEFORE the “XSETROOT=`gdmwhich xsetroot`” line:

SYNERGYC=`gdmwhich synergyc`
if [ x$SYNERGYC != x ] ; then
$SYNERGYC [address of Syngery server]
fi

Save it and restart Gnome. Now the Synergy client should load at startup and connect to the server. This is really a cool solution, it works very well on a local network.

[tags]Apple, Macintosh, Linux, Ubuntu, Feisty Fawn, Synergy[/tags]

Ubuntu Tribe

ubuntu_poster.jpg“Ubuntu Tribe the movie is inspired in the Basque free software developers community, which actually has a lot of handicaps adapting the language to the fast changes of the new technologies. But the effort of this community has made the Basque language not to be threw away, so far, from the information technologies train. In fact, the develop and use of all kind of applications is proportionally much bigger than the real Basque speaking population.

The story of the film Ubuntu Tribe happens between Redmond (USA) and the Basque Country. An high position member of a powerful computer science corporation, Billy, fixes its eyes on a young Basque hacker, Izaro, after she discovered diverse serious vulnerabilities of an operating system called Wista. Privative Software.

Captivated by the good doing of the virtuous developer, he will try to offer a contract at any price, moving to the old continent. Just arrived, he will begin prowling the young girl, who is totally reticent to enter the club of Redmond because of her convictions in favor of free software. The businessman will start bombing her with substantial economic supplies. Without trying it, he will begin to know the social environment where Izaro moves. A humble life, promoting free operating systems in schools and homes of pensioners.

The active and practically altruistic militancy of Izaro will captive Billy, who quickly falls in love with her and starts to know how the Basque speakers world of free software moves.

The stay of the person in charge of Wista is extended more of the awaited, and in the company of Redmond are worried.

Ubuntu Tribe is a semi documentary cyberomantic comedy, to the time that claiming film, rolled under some of the Dogme95 rules. The short movie, still developing, will be distributed on-line under Creative Commons license.

There will be an original version in euskara and two subtitled versions in English and Spanish.

Like we have previously said, the project is still in phase of development. And you can be active part of it. If you have an idea to offer your point of view (a short movie or other artistic disciplines) let us know at the page qualified for such effect or sending a message to info(at)ubuntutribe(dot)com. The ideal is that the works turn around the idea of the Ubuntu philosophy. The received works will be distributed under the Creative Commons license specified by the author.”

More info here.

[tags]Ubuntu, Ubuntu Tribe, Linux[/tags]