linux

Active Directory authentication in Ubuntu

This article will explain how to log inside a Linux box using Windows Domain credentials. This is especially useful in an enterprise environment. I am assuming that my windows username is james.attard and the domain is called ACME. First of all we install Likewise-Open:

james@madvip.net:~$ sudo apt-get install likewise-open

Now we can try to join the domain ACME with a domain administrator account. I'm assuming that my windows username james.attard is part of the domain admins:

james@madvip.net:~$ sudo domainjoin-cli join ACME james.attard

Joining Ubuntu to a Windows 2003 AD

First of all you need to install the following packages:

* Samba (version 3):
o samba
o samba-common (installed by default)
o smbclient (installed by default)
o winbind

* Kerberos:
o krb5-config
o krb5-user

Edit /etc/samba/smb.conf:

[global]
security = ADS
realm = mycompany
workgroup = mycompany
password server = obelix.mycompany
wins support = no
wins server = 10.0.20.202
invalid users = root
# Winbind settings
idmap uid = 10000-20000
idmap gid = 10000-20000
# For testing
debuglevel = 2

aMSN on Ubuntu

aMSN is a very cool instant messenger software similar to Kopete and Gaim which supports webcam. Infact I decided to install the latest aMSN 0.98b from SVN. The only trouble I encountered is to configure correctly tcl/tk 8.5 to de-uglify the fonts (i.e. using anti-aliasing fonts). I found out that I needed to install the libxft-dev package. You can find more details in this howto - http://ubuntuforums.org/showthread.php?t=84765 .


Compiz-fusion and Java desktop apps

I’m using Ubuntu 7.10 desktop edition with compiz-fusion and modal/emergent java windows are not displayed ( only grey background ) to solve this, I added the following environment var on the bashrc / bash_profile of the computer users that must deal with java display applications

export AWT_TOOLKIT=MToolkit

This solves the visualization of java desktop apps with compiz-fusion.


Being root in Ubuntu

One of the main differences between Ubuntu and other distros, is the use of 'sudo' to do anything as root. You are not allowed to log in as root, however there are times when you need to do multiple operations as the root user. In order to achieve this you must type the following command:

sudo -s

Flush sendmail queue

I just found out about this feature for flushing the sendmail queue. This is useful if, say, your mail server was down all weekend and you JUST CAN'T WAIT for the normal queue flush to occur because you've gone through email withdrawal by not being connected for a couple days. In the event that you, say, just rebuilt your mail server and wanted to make sure everything was working correctly you'd also want to watch the queue as it's processing. Normally you'd just run the following to flush the queue and see the results:

/usr/sbin/sendmail -q -v

Finding services on a subnet

Today I needed to find out where was my old workstation in the company. However I had forgot its IP address - the only thing I remembered is that I had an openssh server open. So I needed to scan all the subnet for that particular service (port 22). This is how I did it:

nmap -p 22 -P0 -sT 10.150.3.0/24

Ubuntu 7.10 Gutsy 64 bit on Nec Versa M370

Last week I decided to part for the 64 bit version mostly for the 'cool factor' - I also chose Ubuntu due to its fast installation process.

My main stumbling blocks where finding a suitable wifi driver and getting the inbuilt webcam to work. I still have a couple of problems to sort out, but they aren't really bothering me that much - the sound is coming only from the front speakers and the headphones don't work. Furthermore I still have to make the fingerprint reader to work.

The following are extracts from my lsusb, lspci, and lsmod:

lsusb:

Ubuntu restricted formats

Ubuntu strives to make all software that meets the licensing terms in the Ubuntu License Policy available. However patent and copyright restrictions complicate free operating systems distributing software to support proprietary formats. If you still want to play most common multimedia formats, including MP3, DVD, Flash, Quicktime, WMA and WMV, including both standalone files and content embedded in web pages, you have to install the restricted formats package.

sudo apt-get install ubuntu-restricted-extras

Script to email changes in a file

Suppose you want to email changes in the Oracle's alert log, or maybe syslog's messages, it would be nice to email new 'tailed' entries. Something like tail -f logfile | mailx ... won't work as tail -f will never pipe any output. The idea is to take a snapshot of the file every x minutes, archive it, take another snapshot after x minutes, diff the two files, and email the changes. Then you roundrobin the snapshot and repeat the whole process:

crontab -l
*/5 * * * * /usr/local/bin/swatch-action.sh > /dev/null 2>&1

[root]# cat /usr/local/bin/swatch-action.sh

Syndicate content