1

I changed a lot of linux machines with one command(run as root):

passwd &lt&ltEOF
!@#$!QAZ@WSX
!@#$!QAZ@WSX
EOF

when I logout and tried to login again, it told me that the password was wrong!!!!

I know the problem's with those special characters. Can anyone help me with it? what's the real new password applied to the system when I issue that? I don't want to restore those machines one-by-one manually.....

raam86
  • 6,785
  • 2
  • 31
  • 46
Lu Jun
  • 13
  • 2

1 Answers1

3

You have to boot in a single user mode by appending 1 to the kernel string in the grub menu or lilo and then change your password for root. There is no other way to fix it unless you have the ssh key that is listed in /root/.ssh/authorised_keys and your sshd allows connections for root.

Though try this:

!@#QAZ@WSX

Serge
  • 6,088
  • 17
  • 27
  • 1
    The `$!` in your password as interpreted as the special shell parameter containing the process ID of the last background process. It had a null value, so its expansion was effectively removed from your password, leaving you with the string in the answer. – chepner Sep 29 '12 at 14:09