Operating System - HP-UX
1830936 Members
1959 Online
110017 Solutions
New Discussion

Re: User and password correction at logon

 
SOLVED
Go to solution
Daniel_29
Advisor

User and password correction at logon

I have been able (I don't know why) to use the backspace key to do typing error corrections for user and password.
Without changing nothing it stops working.
Has anyone in idea to get it back again ?
(I have been said by HP hotline that it was impossible ...)
13 REPLIES 13
Mark Grant
Honored Contributor

Re: User and password correction at logon

How are you connecting to the box. If using a serial terminal (does anyone still do that ) I would lookk at /etc/gettydefs for STTY settings. If using Reflections or something like that I'd look at your own PC key map.
Never preceed any demonstration with anything more predictive than "watch this"
Daniel_29
Advisor

Re: User and password correction at logon

Using Powerterm, Reflection and thin clients as dumb terminals.
When it appear to work, it works everywhere, whatever was the connection type, so that I do not think about a keyboard mapping problem.
I have four HP UX boxes and it appears only on one ...
Mark Grant
Honored Contributor

Re: User and password correction at logon

Well, though only thing that sort of makes is if you compare the /etc/gettydefs file on the machines that work against the one that doesn't.
Never preceed any demonstration with anything more predictive than "watch this"
Daniel_29
Advisor

Re: User and password correction at logon

What look strange for me is that I never change that file, neither when it begans to work, neither when it goes back to the original behaviour ...
Mark Grant
Honored Contributor

Re: User and password correction at logon

Well, it probably isn't the problem but it's worth a try.
Never preceed any demonstration with anything more predictive than "watch this"
Rodney Hills
Honored Contributor
Solution

Re: User and password correction at logon

The original default backspace character and line kill has been "@" and "#" respectivelly.

To set them for backspace and ^U I have included the following as part of my system boot (under /sbin/init.d).

stty erase '^H' kill '^U' intr '^C' susp '^Z'

Executing the above once (like at boot) will set the default backspace and line kill characters for all telnet connection. Do a "man stty" for further info.

HTH

-- Rod Hills
There be dragons...
Daniel_29
Advisor

Re: User and password correction at logon

It works very fine !!
I have check it from the command line...
I apologize for my lack of knowledge but I do not know how to put this in my boot sequence. :-((

Can you help me ?
Rodney Hills
Honored Contributor

Re: User and password correction at logon

Create a file called "fix_tty_bs" under /sbin/init.d with the following contents-

#!/sbin/sh
#
#
# Set stty settings for sysconf (so Backspace works on login)
#
PATH=/sbin:/usr/sbin:/usr/bin
export PATH
rval=0
case $1 in
start_msg)
echo "Enable BS to work for Login"
;;
'start')
stty erase '^H' kill '^U' intr '^C' susp '^Z' ;;
*)
echo "usage: $0 {start}"
rval=1
;;
esac
exit $rval

======================
Then "cd /sbin/rc2.d" and create a symbolic link to the new file.

ln -s /sbin/init.d/fix_tty_bs S901fix_tty_bs

This will cause the script to be run each time at system boot.

HTH

-- Rod Hills
There be dragons...
Daniel_29
Advisor

Re: User and password correction at logon

It is so easy when you know about it ...

Thanks.
Bill Hassell
Honored Contributor

Re: User and password correction at logon

Actually, the ttyconf fixup is permanent for all logins once it has been issued. It won't take effect for the console until a reboot, but works for all other connections (serial, modem, telnet). The situation (until recently) was that all terminal connections would default to #=backspace and @=cancel since these were used on hardcopy terminals decades ago. Patches were introduced some time ago to set the defaults for login. login occurs long before any stty settings in /etc/profile so the values must be set in a special way for the driver to remember. It doesn't hurt anything to put the stty settings for ttyconf in a startup file however.


Bill Hassell, sysadmin
Daniel_29
Advisor

Re: User and password correction at logon

This script ask for a parameter.
The link won't give it a parameter at startup time...
Am I wrong
Rodney Hills
Honored Contributor

Re: User and password correction at logon

During startup the script will be launched as-

S901fix_tty_bs start

"start" is passed to each startup script. HP has some documentation on developing startup scripts that discusses this.

HTH

-- Rod Hills
There be dragons...
Bill Hassell
Honored Contributor

Re: User and password correction at logon

All startup scripts are really start and stop scripts. The bootup processing will supply the words start, stop, start_msg and stop_msg depending on what is happening. The best documentation for the script is in /sbin/init.d/template which is a good starting point for creating your own start/stop script. In the case of stty../dev/ttyconf, there is no stop action to take, just put the stty line in the start section, save it with a unique name like /sbin/init.d/miscstartup and then put a symbolic link in /sbin/rc3.d, something like S998miscstartup.


Bill Hassell, sysadmin