home directory overridden by root?

Polytropon freebsd at edvax.de
Mon Feb 27 11:54:05 UTC 2017


On Sun, 26 Feb 2017 15:22:23 -0800, Paul Beard wrote:
> For some reason my home directory reverts to/is confused with /root.
> I login, get dropped at home, but cd will take me to /root and any
> command I run assumes I am in root’s (non-writable) home. How can I
> fix that? I can’t quite make out what’s wrong. 
> 
> FreeBSD www 10.3-STABLE FreeBSD 10.3-STABLE #0 r312644: Sun Jan 22
> 11:36:16 PST 2017     root at www:/usr/obj/usr/src/sys/SHUTTLE  i386
> 
> ssh www
> [successful login]
> [paul at www /home/paul]$ whoami
> paul
> [paul at www /home/paul]$ id
> uid=1001(paul) gid=1001(paul) groups=1001(paul),0(wheel)
> [paul at www /home/paul]$ cd 
> [paul at www ~]$ pwd
> /root
> [paul at www ~]$ sudo grep paul /etc/master.passwd 
> Password:
> paul:[redacted]:1001:1001::0:0:paul:/home/paul:/usr/local/bin/bash
> [paul at www ~]$ 

As you have verified /etc/passwd's setting, something else could
have changed $HOME (this is where "cd" leads you to); in your
case, $HOME probably is set to /root for some reason. For example,
check ~/.bash_login, ~/.bash_profile (as I see bash is your login
shell), and ~/.login_conf, basically anything that can change
environmental variables at login time...




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list