passwd command somehow screwed up the password, lost access to the machine

Bug #1955163 reported by php4fan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
shadow (Ubuntu)
New
Undecided
Unassigned

Bug Description

I had a fresh install of Ubuntu 20.4 Desktop on a server (yes, desktop on a server).
The only extra package installed was ssh.

It was a fresh install of 20.4 desktop as downloaded from the official website, plus the ssh package (and any dependency) installed via apt.

The user created during installation was xxxxx with password "xxxxx" (not the real credentials, I'm using fake ones here, but the username was the same as the password).

I logged in via SSH with user xxxxx:
> ssh xxxxx@123.123.123.123 (obviously this wasn't the real IP)

was prompted for the password, entered it, and I was in.

Then I did:

> sudo passwd xxxxx

(yes I could probably just have done "passwd" without sudoing and without specifying the user, so I would have changed my own password. But that should be the same. I'm sudoing to change the password of an arbitrary user that happens to be myself. No reason why that shouldn't work).

So I was prompted for the current password (because sudo), which I entered, and then I was prompted for a new password that I had to repeat twice and so I did. Let's say the new password was 12345678.

Actually (this shouldn't be relevant), I copied the password from somewhere else and pasted it both times.

I got a message saying the password was changed successfully.

Then I logged out with:

> exit

Now I can't ssh to it anymore.

When I do:
> ssh xxxxx@123.123.123.123

and enter the new password, it says "Permission denied, please try again."
I tried the old password too, with no success.

I also tried ssh root@123.123.123.123, both with the old and new password, but unsurprisingly that doesn't work either (I don't think the root user actually has a password at all, right? and if it does, there's no reason it should be any of those two).

I also tried entering nothing when prompted for the password (just the Enter key, i.e. an empty password, thinking maybe the copy-paste was what failed for whatever reason), but no.

And I also tried both pasting the password and manually typing it.

I'm not asking for help, I'm reporting a bug because whatever happened here, it shouldn't have happened and it caused me to lose access to the machine forever. Luckily it was a freshly installed system so it's no big deal, but in principle this is a disaster.

There's no way I can have mis-typed the password at any stage, because I had it in a text file before I started and I copied and pasted it from there. If somehow some character got screwed up by pasting, and what was saved is not the string that I copied, that would be a bug.

My local machine is linux too and I use a konsole terminal to ssh to the remote machine. To paste copied text I use Ctrl+Shift+V which generally work (I use it all the time to paste into the terminal both locally and when connected via ssh to other remote machines).

Tags: focal
Paul White (paulw2u)
affects: ubuntu → shadow (Ubuntu)
tags: added: focal
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.