13

When I type passwd, I get

Changing password for <user>.
(current) UNIX password:

Now suppose at this point I change my mind and I decide to stay with my old password. What should I do?

Ctrl + C doesn't work. The only way I found is to use a second command line to find out the PID or the running passwd process and then feed it to kill -9 (the standard kill doesn't work either).

Is there a better way, preferably not involving a second command line?

azimut
  • 999

3 Answers3

15

passwd has switched the terminal in completely raw mode --- it will simply read everything you throw at it, included your Ctrl-C and the normally connected to "stop and go background" Ctrl-Z.

The best strategy is simply press Enter and wait for the error:

[romano:~] 10 % passwd                                               
Changing password for romano.
(current) UNIX password: 
passwd: Authentication token manipulation error
passwd: password unchanged
Rmano
  • 32,167
9

I've found the best way to kill su during entering of an incorrect password is Control+U followed by Control+D. This should avoid annoying delays. You can also just clear the input with Control+U and re-try typing the password in.

Box8888
  • 106
0

I tried and got stuck in the terminal, but I found an innovative way that might save you. Keep Pressing the Enter key 3 to 4 times. You will be out of the loop with an output showing passwd:Have exhausted maximum number of retries for service; passwd:password unchanged.

mpboden
  • 3,046