changed home directory and can't login now

Asked by Nicolas on 2013-05-06

Hi all,

Needless to say, I am a complete newbie.

I have a dual boot pc with Kubuntu and Win7. Exploring KDE I went to the User Management and changed the home directory of my user to the folder of my win7 user.

The problem now is that I can't login into KDE. It goes to the login screen, I enter password and after a few blinks it goes back to the same screen. I can access as a guest but under User MAnagement I don't see my user account.

Is there a way to restore my home directory? How can I do it?

I really appreciate your help.

Cheers,

Nico

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu util-linux Edit question
Assignee:
No assignee Edit question
Solved by:
Nicolas
Solved:
2013-05-07
Last query:
2013-05-07
Last reply:
2013-05-07

This question was reopened

Nicolas (nicoenz) said : #1

Running Kubuntu 13.04

N1ck 7h0m4d4k15 (nicktux) said : #2

And why on earth you changed your home directory to point to the Windows home directory ? :P

The simplest solution here is to create a new user and give to the new user admin privileges. Then just delete the old (screwed user) and all of the files.

If you want to save some files from old user account, you can just copy-paste to the new user's account. (admin).

Now lets create a new user.

1) Boot into recovery mode. From Grub menu choose "advanced options for Ubuntu" and select the entry with the (recovery mode) words.

2) From the window options select the "root"

Now pay attention to commands , write them down some where and DO NOT MAKE A MISTAKE ! Everything matters. Spaces, dashes, forward slashes.. caps or small letters.. Everything.

    mount -o rw,remount /
    adduser <username>

Where <username> replace it with the name of the user you want to create. (eg: adduser nikth)

answer to the questions and be careful with the password because nothing will appear when you write it.

After that, give this command

    usermod -aG <username> sudo

again , replace the <username> with the name of the user you just created. Above command will make the user admin.

After that, you can reboot the system with this command

    reboot

and then you can login with the new admin user and delete the old corrupted user. Also before you delete the old user, be sure that you will copy any important files you want to keep.

Regards
 NikTh

Nicolas (nicoenz) said : #3

Dear NikTH,

thank you very much for your answer!! You are my sensei.

fortunately I didn't have too many documents in the home directory since I had re-installed Kubuntu a few weeks earlier and was playing around with the customization when I screwed up. And it's only a matter of re-customizing the interface.

cheers and thanks again

Nico

Nicolas (nicoenz) said : #4

Thanks NikTh, that solved my question.

Nicolas (nicoenz) said : #5

Hi NikTh,

the command:

usermod -aG <username> sudo reports the following:

user 'sudo' does not exist

any ideas what can this be?

Nicolas (nicoenz) said : #6

Solved,

With the root user I could restore the home directory of my initial user and now it works flawlessly!!!

Hurraaaaaayyyyyy!!!!!!!