Friday, August 21, 2009

Setting up Ldap based logins in Hostel Comp Rooms in IIT Bombay

First of all, a sincere thanks to Pankaj Pandey for helping me out in creating this script and the innumerable ways he has helped me.

We have created a script which allows one to set up Ldap based login in computers.

How it works: We have a file called as ldap_logins in config folder. This file contains ldap logins of those students whom who you want to give login access.
When a student enters his login and password, it verifies the ID with ldap and then checks whether his name is present in the file.

Prerequisites: We have tried this method on only Ubuntu computers. So we don't guarantee that this will work on any other system i.e. Fedora , Gentoo, etc . If it works then fine but if it doesn't we cant help you.

You need to have working computer with Ubuntu running on it. Also iitb-repositories must be properly set, i.e. aptitude command should work.

1) Download this script and untar.
2) Run the following commands:
sudo ./
While configuring ldap, it will ask for two things,
b) ou=People,dc=iitb,dc=ac,dc=in

3) Ldap version to be used is 3
4) Select "No" twice.
The script continues and installs other related things.
5) Restart the computer

Go through the script to understand what is happening.

We have also created a python script which will give u ldap logins if you give it a text file containing rollnos. You can get such a list of roll nos from Hall Manager. This script is present in ldap_search folder. The script is straightforward.
To run the script, you need to have ldap module installed.

1 comment:

pankaj said...

nice work, and changing it for use in other distributions is not difficult, just need to replace ubuntu specific apt install commands to other distro. I think the prerequisite installation commands should rather be put aside in a separate distro-specific script. On fedora systems ldap auth is easily done by installing system-config-auth and choosing the appropriate options in the gui.