LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 05-28-2005, 08:12 PM   #1
syreth
LQ Newbie
 
Registered: Sep 2004
Distribution: Slackware, Solaris
Posts: 11

Rep: Reputation: 0
*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?
 
Old 05-28-2005, 09:05 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
What is the name of this directory everyone is going to ?
No error messages ?
What echo $HOME says ?
 
Old 05-28-2005, 09:51 PM   #3
syreth
LQ Newbie
 
Registered: Sep 2004
Distribution: Slackware, Solaris
Posts: 11

Original Poster
Rep: Reputation: 0
The directory is /home/user1

echo $HOME gives "/home/user1"

I stopped the automounter and use /home.
 
Old 05-29-2005, 04:16 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
what gives "type cd" ?
 
Old 05-29-2005, 05:58 AM   #5
syreth
LQ Newbie
 
Registered: Sep 2004
Distribution: Slackware, Solaris
Posts: 11

Original Poster
Rep: Reputation: 0
that gives
"cd is a shell builtin"
 
Old 05-29-2005, 06:08 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
This is strange, run
Code:
id
echo $HOME
cd
pwd
 
Old 05-29-2005, 06:40 AM   #7
syreth
LQ Newbie
 
Registered: Sep 2004
Distribution: Slackware, Solaris
Posts: 11

Original Poster
Rep: Reputation: 0
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"
 
Old 05-29-2005, 07:19 AM   #8
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Id give user1 for root ???
 
Old 05-29-2005, 06:12 PM   #9
syreth
LQ Newbie
 
Registered: Sep 2004
Distribution: Slackware, Solaris
Posts: 11

Original Poster
Rep: Reputation: 0
No id gives what is expected for root:
"uid=0(root) gid=0(root)"
It's just pwd that gives the same for everyone
 
Old 05-30-2005, 12:43 AM   #10
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
This is still weird, please run these commands and post the results:
Code:
exec login root
password: ****
id
echo $HOME
pwd
echo $SHELL
ptree $$
 
Old 05-30-2005, 01:36 AM   #11
syreth
LQ Newbie
 
Registered: Sep 2004
Distribution: Slackware, Solaris
Posts: 11

Original Poster
Rep: Reputation: 0
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: ~:wd
/home/user1
root@thehost: ~::echo $SHELL
/bin/bash
root@thehost: ~:tree $$
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
 
Old 05-30-2005, 02:03 AM   #12
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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..
 
Old 05-30-2005, 02:24 AM   #13
syreth
LQ Newbie
 
Registered: Sep 2004
Distribution: Slackware, Solaris
Posts: 11

Original Poster
Rep: Reputation: 0
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
 
Old 05-30-2005, 02:55 AM   #14
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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
 
Old 05-30-2005, 03:31 AM   #15
syreth
LQ Newbie
 
Registered: Sep 2004
Distribution: Slackware, Solaris
Posts: 11

Original Poster
Rep: Reputation: 0
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Root/Home Directory and setting up FTP for home directories? Mankind75 Linux - Newbie 6 07-23-2006 02:37 PM
c++ home directory bendeco13 Programming 2 11-04-2005 05:27 PM
home directory under a home directory GEEXTER Linux - General 4 04-03-2003 09:17 AM
Can't get in home directory--Help dtsfanatic Linux - General 1 08-10-2002 03:19 PM
home directory TX_metalhead Linux - General 6 06-02-2002 01:41 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 12:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration