You can also create a temporary user and give it sudo rights, if you don't want to drop to recovery mode (but I wouldn't recommend this though, it's rather messy):
Code:
sudo adduser temp
sudo adduser temp sudo
Then log out and log in as "temp", and then:
Code:
sudo usermod -l new_user_name old_user_name
sudo usermod -d /home/new_user_name -m old_user_name # use this command if you want to change the name of your home folder also
sudo ln -s /home/new_user_name /home/old_user_name # some config files will still refer to old home folder. do this to maintain compatibility if you run the above command to change the name of the home folder
After that, log in your new user and delete the temp account, along with its home folder:
Code:
sudo deluser temp
sudo rm -r /home/temp
Bookmarks