How to change the login screen keyboard layout?

Solution 1:

In Ubuntu / Natty, edit the file /etc/default/keyboard, look for the XKBVARIANT setting, and set it to this:

XKBVARIANT="dvorak"

This will tell GDM, the login manager, which keyboard layout to use per default.

Note: the comments in the file warn that this only takes effect after udev is restarted; I would just reboot the machine after changing it.