lock is a simple program which will lock an open terminal window, be it an xterm, or one of the Linux virtual Terminals.
When a terminal is locked you may unlock it by entering your login password. The software relies upon the PAM libraries to do the actual authentification, so it should be fairly customizable.