I was trying to change my username and searching in the internet I’ve found this command:
sudo usermod -l new_username -d /home/new_username previous_username
To apply the changes to all directories.
I ran the command from another user.
But now I can’t log in the principal user back. When I enter the password it keeps returning to the login screem.
How can I revert this miserable changing I’ve done?
new_username? How aboutsudo -i? Does that get you a root shell? – terdon May 13 '24 at 10:04-moption to create the new home directory and copy the old user's files - iirc-dalone does neither, so unless you created/home/new_usernamegraphical login is likely failing because there is no home dir. You should still be able to log in via a CLI virtual terminal (although it will complain and temporarily set the home directory to/). – steeldriver May 13 '24 at 11:33