home directory changed on gnome. Cant access, only throught the text prompt

Asked by yeisi

hello!
i have a little problem, after just installing ubuntu, i changed the username and home directory manually in the 'user and group' tab in the gnome version so when i tried to go back to the terminal i got an error that says: "Your home directory is listed as '/home/new_username' but it does not appear to exist. Do you want to log in with the I (root) directory as your home directory? It is unlikely anything will work unless you use a failsafe session.".
Now i can only enter my ubuntu through the text prompt.. but i cant solve the problem... can anyone help? is there a command i can enter to restore my original home and username?
thank you!!

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Benoit Malet (benoit-malet) said :
#1

Hello !

The command to rename a user is :

sudo usermod -l new_name current_name

If you need to change the home directory, use

sudo usermod -d /home/my_home user_name

Don't forget to replace the values containing an "_" to match your needs.

Regards,
Benoît

Can you help with this problem?

Provide an answer of your own, or ask yeisi for more information if necessary.

To post a message you must log in.