Link to home
Start Free TrialLog in
Avatar of vvvlad42
vvvlad42Flag for Israel

asked on

How do I change the default home path in linux using command line?

Hello Experts,
I recently installed kubuntu. Wanted to change the path to home and used some graphical utility to do that. Everything went fine untill restart.
X wouldn't go up, because permissions issues with the new home.
How can I restore the default home path?

Thanks
Avatar of jcoombes
jcoombes
Flag of United Kingdom of Great Britain and Northern Ireland image

You could try modifying the home directory in the /etc/passwd file for your user.  In order to do this log on as this user (if you can) or root and then edit /etc/passwd within vi or a similar command line editor.

Cheers

JC
You should probably restart to be on the safe side after modifying the entry...
ASKER CERTIFIED SOLUTION
Avatar of bayesianmind
bayesianmind

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vvvlad42

ASKER

bayesianmind:
Thanks.
Already found this, but it appears that I deleted the dir (accidently)
How can I create dir with appropriate ownership?
Avatar of bayesianmind
bayesianmind

mkdir /path/to/new/dir
chown -R user:usersgroup /path/to/new/dir
Avatar of Kerem ERSOY
oh it is simple just copy over the skleton user directory to the new home and change owner such as this:

cp -R /etc/skel /newhome/user
chown -R user.group /newhome/user

That is it. In the first step you've created default user files and in the second step your user and group is the owner of the new directory recursively. the "-R" switchdoes this.

Cheers,
K.
But the correct way is to create it from the skeleton directory. This is what adduser does.
KeremE, you are right, but usually this directory is empty anyway.
it should not be :)