Home set to / on login

Suddenly and without an obvious precipitating incident, when I login, my home is / instead of /home/user/

This creates a lot of problems, obviously, since all sorts of things expect ~/ to be user writable, and expect to find a config in ~/

This happens whether I log in to the GUI, or whether I log in via SSH or TTY. My home is set correctly in /etc/password or if queried using getent. It seems to me that obviously my profile is somehow failing to load. I created a new user “temp” and this loads fine, and user temp is set to /home/temp/ as one would expect.

Is there anywhere I can look to see where and why this is failing?

What’s a precipitating incident, Preciousss? We has never heard of precipitating incidentses before. Is it juicy and deliciousss? Does it comes falling out of the sky like raindropses?

:face_with_hand_over_mouth:

The most common reason for this sort of thing is that the permissions on /home/${USER} have been modified, with as a result that your user account doesn’t have read and execute permission on it anymore, or that your $HOMEhas become owned by another user — usually root, as a result of using a GUI file manager with root privileges. In that case, the system will still allow you to log in — because your user account is still valid — but will not cd into your $HOME anymore.

When logged in as yourself, check your permissions, and the file ownership. :backhand_index_pointing_down:

ls -l /home/${USER}
2 Likes

/home/me still shows as maxsone:maxsone with drwx— etc. Is there a logfile I can look at that might give me some idea where the system is choking?

(I’m not copying and pasting, since I I’m writing this from a test profile, and it’s not convenient to dump output back and forth, but if a more accurate and precise output would be helpful, I can.)

You could check the system log… :backhand_index_pointing_down:

journalctl --boot -0 --no-pager

So “ls -d ~" is actually /?

And echo $HOME?

(And journalctl -f / --follow to see logs live. )

Or you could look into your history-file :wink:
This will show what you did in the last days.

1 Like

Is $HOME itself still owned by the correct user?
ls -al /home

Are there any root owned files inside your $HOME?
ls -al /home/${USER} | grep root

To check the bash history file
grep chown /home/${USER}/.bash_history

I’m not familiar with zsh - the file name is .zhistory I believe.

All this from an account with access rights → root
sudo su
to get there

If GUI tools where used, nothing will show up in the shell history - only terminal commands will be there.


ps:
or some other cause, like:
you have a separate partition for the contents of /home
and it has got some problem

inxi -zv8
is usually requested anyway for any kind of issue asked here:

To avoid problems with storing output and/or cut+paste, use this:

inxi -zv8 > outputfile
curl -F 'file=@outputfile' https://0x0.st

and return the link that comes back

or this variant - a different service
openbsd-netcat needs to be installed for this to work:
inxi -zv8 | nc termbin.com 9999

2 Likes