If you need to input password to login ubuntu and there are numbers in the password,it’s very annoying that you need to press NumLock key to enable number pad every time you login.
Here’s how to enable NumLock when startup into login window.

UPDATE: For Ubuntu 11.04+ default LightDM:

Install numlockx (see step blew), then add this line to “/etc/lightdm/lightdm.conf”

greeter-setup-script=/usr/bin/numlockx on


For Ubuntu Gnome and Xubuntu XFCE (GDM)
Install numlockx by this command in terminal(Applications/Accessories/Terminal):

sudo apt-get install numlockx

edit /etc/gdm/Init/Default with your favourite editor:

sudo gedit /etc/gdm/Init/Default

add following above the last line which says exit 0:

if [ -x /usr/bin/numlockx ]; then
/usr/bin/numlockx on

Similar to GDM,edit /etc/kde4/kdm/Xsetup (if you are still running kde3 you will want to edit /etc/kde3/kdm/Xsetup instead) and add the following code to it:

if [ -x /usr/bin/numlockx ]; then
/usr/bin/numlockx on

For more,see:https://help.ubuntu.com/community/NumLock