I did something REALLY silly - I did ... sudo vi /etc/passwd Then I changed the username to the user I wanted, I exited the file.
Now - the user password no longer matches, I can't change the password as I can't enter the current password. I can't sudo (as the password no longer matches). I'm still logged in though.
Is there a way out? I encrypted the disk - if I take it out, can I mount it on another machine?
Sam
pkexec
works in situations wheresudo
doesn't - trypkexec vipw
(orpkexec vipw -s
if you wish to change the shadow file to be consistent with the modified passwd file). – steeldriver Jun 28 '18 at 15:52