LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   *different* home directory issue (https://www.linuxquestions.org/questions/solaris-opensolaris-20/%2Adifferent%2A-home-directory-issue-328099/)

syreth 05-28-2005 08:12 PM

*different* home directory issue
 
I have my users' home directories where I want them so it's not that "/export/home vs /home" problem I don't think. It seems that all users (root included) have the same home despite being clearly different in /etc/passwd. That is to say that regardless of who logs in, they are taken to the home directory of the first user I made when typing "cd". So if user2 logs in he is taken to user1's home and must go to his home manually by typing "cd ../user2" for example. Root even uses user1's home. My /etc/passwd file looks like this:

root:x:0:0:Super-User:/:/bin/sh
daemon:x:1:1::/:
bin:x:2:2::/usr/bin:
sys:x:3:3::/:
adm:x:4:4:Admin:/var/adm:
lp:x:71:8:Line Printer Admin:/usr/spool/lp:
uucp:x:5:5:uucp Admin:/usr/lib/uucp:
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico
smmsp:x:25:25:SendMail Message Submission Program:/:
listen:x:37:4:Network Admin:/usr/net/nls:
gdm:x:50:50:GDM Reserved UID:/:
webservd:x:80:80:WebServer Reserved UID:/:
nobody:x:60001:60001:NFS Anonymous Access User:/:
noaccess:x:60002:60002:No Access User:/:
nobody4:x:65534:65534:SunOS 4.x NFS Anonymous Access User:/:
user1:x:100:1::/home/user1:/bin/bash
user2:x:101:1::/home/user2:/bin/bash

I can't figure out why it's acting this way. Any insight?

jlliagre 05-28-2005 09:05 PM

What is the name of this directory everyone is going to ?
No error messages ?
What echo $HOME says ?

syreth 05-28-2005 09:51 PM

The directory is /home/user1

echo $HOME gives "/home/user1"

I stopped the automounter and use /home.

jlliagre 05-29-2005 04:16 AM

what gives "type cd" ?

syreth 05-29-2005 05:58 AM

that gives
"cd is a shell builtin"

jlliagre 05-29-2005 06:08 AM

This is strange, run
Code:

id
echo $HOME
cd
pwd


syreth 05-29-2005 06:40 AM

id gives
"uid=101(user1) gid=1(other)"

echo $HOME as before, gives
"/home/user1"

cd still goes to /home/user1

pwd gives the same for all users, including root:
"/home/user1"

jlliagre 05-29-2005 07:19 AM

Id give user1 for root ???

syreth 05-29-2005 06:12 PM

No id gives what is expected for root:
"uid=0(root) gid=0(root)"
It's just pwd that gives the same for everyone

jlliagre 05-30-2005 12:43 AM

This is still weird, please run these commands and post the results:
Code:

exec login root
password: ****
id
echo $HOME
pwd
echo $SHELL
ptree $$


syreth 05-30-2005 01:36 AM

The result is:

user1@thehost: ~::exec login root
Password:
Not on system console
root@thehost: ~::id
uid=0(root) gid=0(root)
root@thehost: ~::echo $HOME
/home/user1
root@thehost: ~::pwd
/home/user1
root@thehost: ~::echo $SHELL
/bin/bash
root@thehost: ~::ptree $$
392 /usr/lib/ssh/sshd
638 /usr/lib/ssh/sshd
641 /usr/lib/ssh/sshd
643 -bash
647 bash
652 bash
678 bash
683 bash
687 bash
688 bash
693 bash
699 bash
701 bash
758 bash
805 bash
961 ptree 805

jlliagre 05-30-2005 02:03 AM

As login fails, the rest of the command results are useless ...

Well, run again these commands either while already logged in locally, or after allowing root to log in remotely by commenting out the CONSOLE line in the /etc/default/login file.

And please enclose your results with "code" tags..

syreth 05-30-2005 02:24 AM

I was logged in as root whilst running those commands. If I allow remote login as you specified and attempt to login as root from another user I get

Code:

user1@thehost: ~::exec login root
Password:
No utmpx entry. You must exec "login" from the lowest level "shell".
-bash-3.00$ exec login root
Password:
Last login: Mon May 30 01:23:52 on pts/1
-bash-3.00# id
uid=0(root) gid=0(root)
-bash-3.00# echo $HOME
/
-bash-3.00# pwd
/
-bash-3.00# echo $SHELL
/bin/bash
-bash-3.00# ptree $$
392  /usr/lib/ssh/sshd
  974  /usr/lib/ssh/sshd
    977  /usr/lib/ssh/sshd
      979  -bash
        991  ptree 979


jlliagre 05-30-2005 02:55 AM

Ok, that looks almost correct, and doesn't exhibit the problem you are complaining of, being all users home being "/home/user1", even for root as you wrote in your first posting:
Quote:

Root even uses user1's home.
There is anyway a small and perhaps unrelated problem, your /etc/passwd set /sbin/sh as the shell used by root, but ptree is showing bash is used instead.
My first guess is you have messed up either your /etc/profile or /.profile

syreth 05-30-2005 03:31 AM

I guess the difference is when using "su" instead of "exec login". When I log in normally and just su between accounts this behavior occurs. I thought they were the same. Thanks for your help.


All times are GMT -5. The time now is 07:44 PM.