Operating System - HP-UX
1748139 Members
3640 Online
108758 Solutions
New Discussion юеВ

Re: login() password problems

 
SOLVED
Go to solution
David Bonham_1
Advisor

Re: login() password problems

I got it! Thank you, especially Sundar!

The correct syntax was:

stty erase ^H < /dev/ttyconf
stty intr ^C < /dev/ttyconf

Perfect! Now I can use both @ and # in passwords. Thanks!
Gord Moore
Frequent Advisor

Re: login() password problems

So, would this be a list of special characters
that users should NOT include in passwords:
# because it means kill
@ because it means interupt
& because it means erase line
\ because it means "escape"

Any others?
Bill Hassell
Honored Contributor

Re: login() password problems

The list of special characters for login is defined by the driver defaults. These default values are listed in the man page termio (close to line 300: Special Characters

The termio list is lengthy but the most common are # (erase previous character) and @ (cancel current line). & is not defined as anything special and does not erase the line. \ is not special either. It means escape the next character but only to a shell (unless ICANON was set with /dev/ttyconf). Remember that login has nothing to do with a shell prompt. login and password occur completely outside the environment setup in a shell...or more accurately, the shell sets up it's own environment after login with /etc/profile where stty is used to change the driver defaults.

As mentioned, the special device file /dev/ttyconf was created to allow changing the driver defaults before login. As to which characters to avoid, you have to decide whether to reassign the defaults. If so, then # and @ are fine to use...unless of course you are using passwords across many different operating systems. You must check with each one as to reserved characters.

Once logged on, special characters are now defined by the shell and may be different for different shells and of course, the user may change these in a local .profile or simply use the stty command. Again, all the shell features occur long after login/password have been handled.


Bill Hassell, sysadmin