4

I do not know my administrative password. I read up on how to reset it by clicking Left Shift after the BIOS page upon start up, going to the recovery option, then root, then doing mount -o rw,remount /, but then I believe I must do passwrd <username> to change the password. HOWEVER, my keyboard does not have a working P key.

Does any one know of an alternative way to reset the administrative password without the use of a P key? If not, does anybody know of a clever way to utilize the letter p in the command prompt without a working key?

Or perhaps anyone might know how to find out your password without having to change it at all? Thank you for your time.

1
  • 2
    This sounds like a fun challenge.
    – Kaz Wolfe
    Jan 23, 2014 at 2:59

3 Answers 3

14
$'\x70'asswd

will mean passwd in bash, because $'x70' means p. See here for more info on this feature.

ASCII table here or in man ascii, you need the hex value for the character, for p it is 70 so you produce it with $'x70' .


Or if you already installed zsh and have turned on the interactive menu completion then from a zsh shell you can cd /usr/bin/. And then type ./ and press TAB and keep it pressing/pressed until the interactive menu completion kicks in and then just select passwd with the cursor keys.

Or if you have mc (Midnight Commander) installed you can use that to select /usr/bin/passwd and then press ENTER on it to launch it or ALT+ENTER to copy the selected filename to the command line. (In this case you will likely need the latter as you will have to supply the username also to the command line because you are not changing the root's password but some user's. So simply launching passwd is not want you want.)

Or any similar interactive selection program should work, but obviously these should be already installed on your system as now you don't have access to the admin password so you can't install anything.


Or if you have only passwd in /usr/bin/ which has only one letter before asswd (on a default setup this is true) then of course you can just use bash's globbing features and simply type:

/usr/bin/?asswd

to launch passwd.

0
4

When you need a capital P, hold ALT, press 8 0 (use the keypad)

When you need a lowercase P, hold ALT, press 1 1 2 (use the keypad)

Buy a new keyboard :).

http://tools.oratory.com/altcodes.html

3
  • could you please elaborate on Alt codes
    – mcantsin
    Jan 22, 2014 at 22:59
  • 3
    This is a windowsism. Nothing wrong with the answer but doesn't work on linux as is and is just worth a mention.
    – mike3996
    Jan 23, 2014 at 8:51
  • props for the 'windowsism' term @progo Jan 23, 2014 at 11:23
2

The other answers are already quite good - but in a pinch, you can use copy/paste to grab a 'p' from somewhere and paste it where needed. I've resorted to this several times when working with bad keyboards...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .