Disabled root ssh access, lost user password, any way around it?

I think I know the answer to this but I hope I'm wrong. I've disabled root ssh, but the password for the user has been lost so can't su or sudo. Is there anyway to reenable root ssh access or reset the user password?

Even in Rescue mode and LISH I can't see a way around. Any help is much appreciated.

2 Replies

You can always login as root at the (lish) console. You’ll need the password though.

Do you have any users with sudo access? If so, login as one of those (ssh or lish console); enter su & that user’s password; and shazam! you’re the root user!

— sw

Thanks for the answer Steve. I just figured it out, somehow my terminal was in bracketed paste mode so was adding 0~ 1~ to everything I pasted into terminal, but because I was pasting a password I couldn't see it! I did a reset and it fixed it. Never had that problem before.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct