Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
${HOME} Set Wrong
${HOME} Set Wrong
Hi,
Hoping someone can help as have spent a good few hours searching for a solution but with no luck.
On root login the HOME variable is set to ${HOME}
So when you do cd ~ it just tries to go to whatever directory you were in followed by ${HOME}
Also on login it seems to be ignoring the .profile script
Any help would be most appreciated.
Debian Version 7.11
Thanks
Hoping someone can help as have spent a good few hours searching for a solution but with no luck.
On root login the HOME variable is set to ${HOME}
So when you do cd ~ it just tries to go to whatever directory you were in followed by ${HOME}
Also on login it seems to be ignoring the .profile script
Any help would be most appreciated.
Debian Version 7.11
Thanks
- roseway
- Posts: 1528
- Joined: 2007-12-31 22:50
- Location: Kent, UK
- Has thanked: 3 times
- Been thanked: 4 times
Re: ${HOME} Set Wrong
I never log in as root, but if I become root from my user account then HOME is reported correctly:
eric@nuthatch:~$ echo $HOME
/home/eric
eric@nuthatch:~$ su
Password:
root@nuthatch:/home/eric# echo $HOME
/root
root@nuthatch:/home/eric# cd ~
root@nuthatch:~# pwd
/root
root@nuthatch:~#
eric@nuthatch:~$ echo $HOME
/home/eric
eric@nuthatch:~$ su
Password:
root@nuthatch:/home/eric# echo $HOME
/root
root@nuthatch:/home/eric# cd ~
root@nuthatch:~# pwd
/root
root@nuthatch:~#
Eric
Re: ${HOME} Set Wrong
It was working correctly and is on other servers I have, just it seems to of corrupted itself somehow but cannot find a way to permanently set it back to the correct path.
Re: ${HOME} Set Wrong
please post the output of this:
as root, and as normal user.
edit:
your op sounds like you might have used single quotes around '${HOME}' somewhere...?
Code: Select all
echo ${HOME}
edit:
your op sounds like you might have used single quotes around '${HOME}' somewhere...?
Re: ${HOME} Set Wrong
OK it seems to be doing it for all users, hadn't noticed on other user accounts before as I very rarely login.
As root and other users:
As root and other users:
Code: Select all
echo ${HOME}
${HOME}
Code: Select all
env
HOME=${HOME}
-
- Posts: 1100
- Joined: 2016-01-07 12:25
- Has thanked: 5 times
- Been thanked: 16 times
Re: ${HOME} Set Wrong
You could try setting the home dir manually with as root (or with sudo)
Code: Select all
usermod -d /home/whatever_dir whatever_user
Re: ${HOME} Set Wrong
Tried that and get
When logged in it is going to the correct home directory, just after that it has it set as ${HOME}
Code: Select all
usermod: no changes
-
- Posts: 1100
- Joined: 2016-01-07 12:25
- Has thanked: 5 times
- Been thanked: 16 times
Re: ${HOME} Set Wrong
Then I can only think this would be relevant
/etc/.bashrc
/etc/X11/xinit/xinitrc
/etc/profile
~/.bashrc
~/.profile
some files I would check are:-debiman wrote:your op sounds like you might have used single quotes around '${HOME}' somewhere...?
/etc/.bashrc
/etc/X11/xinit/xinitrc
/etc/profile
~/.bashrc
~/.profile
Re: ${HOME} Set Wrong
Thanks for your suggestions as I finally found where it was set after running:
I have commented out and now working.
Thanks
Code: Select all
grep -r '${HOME}' /etc/
/etc/security/pam_env.conf:HOME=${HOME}
Thanks
Re: ${HOME} Set Wrong
That file is installed/owned by libpam-modules, which certainly doesn't come with that wrong line (at least mine -- sid -- is empty).waldo99 wrote:Thanks for your suggestions as I finally found where it was set after running:
I have commented out and now working.Code: Select all
grep -r '${HOME}' /etc/ /etc/security/pam_env.conf:HOME=${HOME}
Thanks
Which means ${you} have changed that for some reason.