1834732 Members
3124 Online
110070 Solutions
New Discussion

Re: Bad root password

 
Wilson Li_1
Occasional Contributor

Bad root password

I've got a system running HP-UX HPUX11IN B.11.11 U 9000/800 3745452784 unlimited-user license. I logged on as myself, su'd to root, and changed root's password. However, I can't seem to type the password correctly.

The password I entered is only 7 characters long, and it includes two @ symbols. I mention this because I tried changing another non-root password to the same thing, to see it in the passwd file. However, I get "Password too short - must be at least 6 characters". For this reason, I suspect the root password entry is corrupted.

Does this ring any bells?

I've seen many posts about ways to overcome a lost root password, and I will investigate those options.
13 REPLIES 13
Steven Schweda
Honored Contributor

Re: Bad root password

No bets, but you might check an "stty -a"
report to see if "@" is being damaged (or
interpreted in an unexpected way) by the
terminal input code. HP-UX does have some
fairly abnormal settings for some of the
special functions.
Bill Hassell
Honored Contributor

Re: Bad root password

The @ character is the problem. It is the default cancel-entry character, just like # is the default backspace character. These defaults are leftover from the days of teletypewriters. It doesn't matter what OS you use, there will be special characters that you must avoid. Just stay away from the special chars across the top of your keyboard.

Now the passwd file is useless because the encrypted password will *ALWAYS* be 13 characters no matter how short or long the original password. To fix the problem with root's password, you'll have to boot up into siongle user mode, then remove the root password with vi. Note: Always mount /usr /tmp and /var before running vi. When the root password is null (root::0: ...etc) you can now run the passwd program to set a new alphanumeric password.

There are several steps to change the default # and @ special characters but it is far better to get in the habit of using A-Za-z0-9 only for all your passwords.


Bill Hassell, sysadmin
Steven Schweda
Honored Contributor

Re: Bad root password

> These defaults are leftover from the days
> of teletypewriters.

Perhaps on HP-UX, but where else?
Teletypewriters had Backspace and Delete
keys, too, which is what practically everyone
else used in the old days (and still uses).
More likely, these defaults date back to
(badly designed) HP terminals, not real TTYs.
Consider, for example, a few common UNIX
systems:

td163> uname -a
Linux td163.testdrive.hp.com 2.6.18-8.1.4.el5 #1 SMP Fri May 4 22:15:17 EDT 2007
x86_64 x86_64 x86_64 GNU/Linux

td163> stty -a
speed 9600 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ;
eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
[...]


urtx> sizer -v
HP Tru64 UNIX V5.1B (Rev. 2650); Mon Feb 19 11:57:07 CST 2007

urtx> stty -a
#2 disc;speed 9600 baud; 24 rows; 80 columns
erase = ^?; werase = ^W; kill = ^U; intr = ^C; quit = ^\; susp = ^Z
dsusp = ^Y; eof = ^D; eol = ; eol2 = ; stop = ^S
start = ^Q; lnext = ^V; discard = ^O; reprint = ^R; status =
[...]


sol> uname -a
SunOS sol 5.10 Generic_118822-25 sun4u sparc SUNW,Ultra-60

sol> stty -a
speed 9600 baud;
csdata ?
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^\; erase = ^?; kill = ^u;
eof = ^d; eol = ; eol2 = ; swtch = ;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;


smacg3f:~ sms$ uname -a
Darwin smacg3f.antinode.org 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:
17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Power Macintosh powerpc

smacg3f:~ sms$ stty -a
[...]
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = ;
eol2 = ; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ;
stop = ^S; susp = ^Z; time = 0; werase = ^W;


And so on, and so on, ...

Notice how everyone else seems to default to
using reasonable control characters for the
special functions (like CRTL/U for kill, or
Delete for erase, but not for intr, where
CTRL/C is practicaly universal)?

> It doesn't matter what OS you use, there
> will be special characters that you must
> avoid.

True, but assigning "intr" to Delete is one
of the lamest choices possible, ranking right
up there with assigning "kill" to @.

> Just stay away from the special chars
> across the top of your keyboard.

Or from the totally goofy default stty
settings in HP-UX.
Dennis Handly
Acclaimed Contributor

Re: Bad root password

>it includes two @ symbols.

If you insist on using "@", you can quote them with "\" when you logon.

I believe there is a way to configure getty to set the defaults differently.

>Bill: To fix the problem with root's password, you'll have to boot up into siongle user mode, then remove the root password with vi.

No need, use "\" as I mentioned.

>Steven: these defaults date back to
(badly designed) HP terminals, not real TTYs.

I seriously doubt it dates back to HP (great ones BTW) terminals. It dates back to TTYs as Bill says, where you couldn't erase.

I agree it may not make sense now.
Steven Schweda
Honored Contributor

Re: Bad root password

> It dates back to TTYs as Bill says, where
> you couldn't erase.

The TTYs I used had Delete keys ("RUB OUT"?).
That was the one which punched all the holes
across the paper tape. Which is why the
ASCII for DEL is all ones instead of being in
the low numbers with the regular control
characters (like BS). I'll admit that my
memory of the KSR33 is growing dim, however.

In any case, notice that no other UNIX
(-like) OS seems to be suffering from this
problem, nor does VMS (nor did its PDP-11
antecedents), and that includes a good deal
of history and legacy compatibility, too.
Dennis Handly
Acclaimed Contributor

Re: Bad root password

>Steven: The TTYs I used had Delete keys ("RUB OUT"?).

Since I never had TTYs on UNIX, I can't confirm. I think I used the obvious big round backspace key. I forget what I used for kill.
Steven Schweda
Honored Contributor

Re: Bad root password

> I can't confirm.

I did find a hard-to-read picture on:

http://www.vintage-computer.com/asr33.shtml

Between my hardware and my meatware, I can
make out ESC and CTRL on the left, and, I
believe, HERE IS, LINE FEED, RE-TURN, RUB
OUT, REPT, and BREAK on the right. It's
conceivable that RUB OUT punched tape but did
not transmit a DEL character, but I'd bet a
small sum on its sending a DEL. (There's
some fine print on some keys, like TAB on the
"I", but nothing on the "H", so they weren't
making the BS as obvious as some other CTRL/x
possibilities.)

I'll bet that the fellow with the question is
just fascinated by all this historical
speculation. Anyway, I still have no
sympathy for the default stty settings on
HP-UX. I wouldn't expect to be able to
specify a CTRL/S in a password, but a problem
with a normal, printable character like "@"
is just too lame.
Dennis Handly
Acclaimed Contributor

Re: Bad root password

>Steven: I did find a hard-to-read picture on:

Here is a much better picture I found with google:
http://highgate.comm.sfu.ca/~djg/htdocs/asr33/pics/kbd_top.shtml?large

So I have no idea how I erased letters, it probably varied.
Steven Schweda
Honored Contributor

Re: Bad root password

> Here is a much better picture [...]

Sure is. Ah, the good old days. If the
answer ever appears for the
what-does-the-RUB-OUT-key-do question, be
sure to let me know.

If you're looking for a good reason to feel
(at least a little) smug, it's only sometime
in the past year or two that VMS has gained
the ability to interpret a backspace as a
delete. (But you could put an "@" into a
password without breaking a sweat for a long
time.)
Dennis Handly
Acclaimed Contributor

Re: Bad root password

Well, for the last N decades, I've never used the delete key. There was a delete char key on HP terminals. The del key always caused nasty things to happen (bad parity too?), so I never used it.

So when I'm on a PC, I don't know I can use that key and I so instead look for some menu or button I can mouse. :-(
Bill Hassell
Honored Contributor

Re: Bad root password

OK, the TTY term refers to the classic ASR33 and ASR35 teletypes that were the only devices available back in the 50's and 60's as a computer console. Yes, both ASR models had a backspace key but as with 100% of all paper devices, the backspace key could *NOT* erase any character -- the ink is still on the paper. The only common use of the backspace key is to create hardcopy enhancements, specifically BOLD characters, by backspacing and retying the character several times, making it darker on the paper. This explains why looking at raw man pages will show lots of backspace characters.

So as a totally practical matter, erasing a character had to be visible and thus, you type a wrong character, then # to erase it and then the correct character -- which is how the default stty setting works in HP-UX.

The # character was picked because the RUBOUT character would punch a complete set of holes in the paper tape, effectively rubbing-out that character. Since # looks sort of like a bunch of rubouts on paper tape, that became the convention.

Starting with a patch at 11.00, a new device file is now available for changing selected default stty values, specifically kill and erase characters. The device file is /dev/ttyconf and works like this:

stty erase "^H" kill "^U" intr "^C" < /dev/ttyconf

Just issue this command and now all new terminal connections (except the console) will be set to the new defaults. And you can set the default value as a startup script so that it fixes the console at the next reboot (the console is always open when HP-UX is running). Standard /etc/profile and .profile files have this already but these profiles do not affect the login settings. Use ttyconf to fix the login/password issues.

As to why HP still continues to keep these truly archaic settings (also including 300 baud as the default serial rate), some questions are best left unanswered...just use the fix mentioned above.

More trivia: HERE-IS is called the answer-back key and in the old days of teletypes, the 'network' run mostly by Western Union, would require identifying that the remote terminal is the correct TTY. The local operator would issue a query to trigger the answer-back drum, a mechanical cylinder that had the tty's identification string. To trigger the drum manually, the operator would push the HERE-IS key. This is how HP's nifty terminal ID program works. Glass terminals adopted most of the tty features including answer-back and the program ttytype sends out the 3 major categories of answer-back characters, waiting for a second to see if anything is sent back. For instance, an HP terminal will respond to ESC ? at which point there are other sequences to obtain more details.

(Oh, I read about all this in a museum -- I'm much too young to have ever touched these old things...)


Bill Hassell, sysadmin
Steven Schweda
Honored Contributor

Re: Bad root password

The HERE-IS mechanism can be seen in the
lower left of:

http://highgate.comm.sfu.ca/~djg/htdocs/asr33/pics/main_back.shtml?large

As I recall, the programming was done by
selectively breaking off those little
finger-like cams on the phenolic drum.
Better if you did it right the first time.
NVRAM is easier to change.
OldSchool
Honored Contributor

Re: Bad root password

Gee guys, you're making my all misty-eyed w/ sentiment. I wonder what happened to
a) my old DEC-Writer (with the 1200 baud conversion thank-you-very-much)
b) boot tape for above on the V77-600 Sperry Univac
and my drum storage.