Which file determines directory at login?

I can’t figure out which file controls the directory you are in once you login as root. I tried putting “cd /andy” into the sysinit.1 file, but that didn’t work. Where does this need to go? I didn’t have a .profile in the root directory, so I created one and put “cd /andy” as the last entry, but that didn’t work either. Help!

Guessing here, but maybe /etc/profile?

How do I do it though? I added “cd /andy” (without quotes) as the last line of /etc/profile and it didn’t work.

/etc/passwd defines everybody’s $HOME directory. $HOME directory is where you end up with after you login.

Ok, but how do I end up at /andy after login?

Are you asking how to achieve that? or explanations on why it is doing that to you?

post the output of “grep root /etc/passwd” and “grep andy /etc/profile”.

I’m asking how I achieve that.


cd /andy

Well, I think I fixed this problem. I didn’t have Fsys.eide & in my sysinit.1 file. I still need help with the original question though. Thanks.

I thought those had been discussed here:

to re-cap:

  1. for root’s home dir, please edit /etc/passwd to change root:x:0:0::///:/bin/sh to root:x:0:0::/andy:/bin/sh

  2. add some sleeps in sysinit.X file (before “tinit”).

Thanks again, noc!

Tell me something though, my work QNX box defaults to the /andy directory after login, but my /etc/passwd on that box reads: root:x:0:0::///:/bin/sh