Ask Your Question
1

Upon login current working directory is /, not $HOME

asked 2013-01-14 09:27:39 -0500

ocharles gravatar image

Hi,

I use XFCE with GDM, and currently when I login my current working directory is set to /, not /home/ollie as I'd expect. I'm not really sure where to start looking to solve this, but it's a tad frustrating when everything keeps opening in the wrong directory!

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2013-01-15 16:32:15 -0500

ocharles gravatar image

Solved it! My home directory had an incorrect SELinux profile, the following fixed it:

semanage fcontext -a -t user_home_t /home
restorecon -v /home

Attempting to login to console 2 showed the error, so I was finally able to track it down.

edit flag offensive delete link more
0

answered 2013-01-14 20:32:29 -0500

sideburns gravatar image

Run this command in a terminal:

cat /etc/passwd | grep ollie

If the second item from the right isn't /home/ollie, edit the file (as root) so that it is. Log out, log in and it should be working correctly.

edit flag offensive delete link more
0

answered 2013-01-14 10:20:28 -0500

ztank1013 gravatar image

updated 2013-01-14 16:52:24 -0500

It might not work if there is some problem with the /home file system but you should give this a try.
As root run the following:

usermod --home /home/ollie ollie

Edit
I see your default shell is zsh. Please take a look in to the following files and check if there is some directive there to change your default shell to be / (root)

$ZDOTDIR/.zshenv
$ZDOTDIR/.zprofile
$ZDOTDIR/.zshrc
$ZDOTDIR/.zlogin
$ZDOTDIR/.zlogout
/etc/profile

If ZDOTDIR is not set, then the value of HOME is used; this is the usual case.
For more info visit the following link http://zsh.sourceforge.net/Intro/intro_3.html

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-01-14 09:27:39 -0500

Seen: 442 times

Last updated: Jan 15 '13