How To change $HOME from Command line

Asked by Avinash M

I changed my HOME folder of my login by mistake and am not able to login now since the the new HOME folder does not have sufficient permissions.
How do I change $HOME back to the original path using command line

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Avinash M
Solved:
Last query:
Last reply:
Revision history for this message
Thomas Templin (coastgnu) said :
#1

Hello Avinash
On Mon, 21. May 2007 08:23:25 Avinash M wrote:
> New question #6951 on Ubuntu:
> https://answers.launchpad.net/ubuntu/+question/6951
>
> I changed my HOME folder of my login by mistake and am not able to login
> now since the the new HOME folder does not have sufficient permissions. How
> do I change $HOME back to the original path using command line

First, we will find a way how to solve your problem.

But I need a bit more information, please.

What exactly did you do, (which commands did you use)?
 Did you just add a new /home partition or did you change the /home entry in
 the /etc/passwd file?
 How did you change your 'HOME folder'?

What are the permissions of the new /home?

regards,
thomas

Revision history for this message
Best Avinash M (avinashmadhugiri) said :
#2

hi Thomas,

Based on your reply, I was able to login as root and change the
path in /etc/passwd.

Thank you.
Avinash M

Revision history for this message
Thomas Templin (coastgnu) said :
#3

On Mon, 21. May 2007 11:01:48 Avinash M wrote:
> Question #6951 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/6951
>
> Status: Answered => Solved
>
> Avinash M confirmed that the question is solved:
> hi Thomas,
>
> Based on your reply, I was able to login as root and change the
> path in /etc/passwd.
You also could have done a link from the old /home to the new place, e.g.:
Given a new directory named /data/user1 which has the data of user1.
 ln -s /data/user1 /home/user1

If you changed the users home because of lack of disk space it might be an ide
to have a second disk as /home partition.
I'm using such a seperate disk since warty and this disk also was my /home for
SUSE and Debian before.

The benefit would be:
- more capacity for user data stored in /home
- a bit more flexibility for later upgrades
  E.G. I always do a fresh install for new ubuntu versions. For this I
  installe the distribution as usual and add the /home disk _after_ the
  installation.
- You may take this disk for another system (as I did for SUSE and Debian
  in the past)

regars,
thomas

Revision history for this message
doomster (dvalilis) said :
#4

hello . is there a way to change my /home folder and use another partition for this job, without reinstalling ubuntu?

Revision history for this message
Bhavani Shankar (bhavi) said :
#5

Yes you can change your home folder... If you are on fiesty... System => Administration => Users and groups.. That should open Users settings and Properties => Advanced where you can change your home folder..

Revision history for this message
Ex ISP (ex-isp) said :
#6

These answers are very close for me but not quite nailing it.

I discovered that I had 29GB of unused/unactive partition space on an IDE HDD. Using the GUI partition manager in KDE, I mounted it as /home. That made all the profiles, links to progs, etc, break. The oly way I can get back in is through "safe-mode" and in Gnome, which is not my native environment. I really want to get KDE working again.

I checked /etc/passwd and it is pointing to /home/chris as it should be. I'm really lost here and would hugely be thankful for any help in the right direction. I think I understand why I'm in this mess...just not sure how to recover from it!

Thanks!