10

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
  • 949
  • 2
  • 12
  • 27

2 Answers2

14

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
  • 31,627
  • 16
  • 118
  • 187
  • 4
    If you decide to abort after providing your password in the first step, then just type mismatching passwords. – cubuspl42 Jul 04 '19 at 07:45
6

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
  • 76
  • 1
  • 1