su command failed ("No directory")

I am trying to set up the environment in Solaris in order to install Oracle. I added a oinstall and dba groups:
# /usr/sbin/groupadd oinstall
# /usr/sbin/groupadd dba
then created the oracle user:
# /usr/sbin/useradd -g oinstall -G dba oracle
And I set the passwd for oracle as follows:
# passwd -f files oracle
But when I try to login as oracle, as follows:
su - oracle
I got an error "No directory".

Then I tried creating a directory /home/oracle (this was specified in /etc/passwd) using mkdir, but the command failed with "Operation not applicable".
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You'll probably have the automounter running.  Do your users use automounted home dirs?  If not, then disable automounter by doing

/etc/init.d/autofs stop
rm /etc/rc2.d/S74autofs

The above is appliable for Solaris <=9

For Solaris 10, do

svcadm disable autofs

yongsingAuthor Commented:
What is automounted home dirs?
yongsingAuthor Commented:
What if I still want the automounter? I am not sure if I should disable it permanently.

I tried the following to create home directory for oracle user:

# /usr/sbin/useradd -g oinstall -G dba -d /export/home/oracle -m oracle

The home directory was created, but the "su - oracle" command still returns me "No directory!" error.
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Maybe there is an error with the directory, here is what to check.

First look in the /etc/passwd file  the line that starts with oracle should have the directory listed in it.

Then try;  cd /export/home/oracle   (make sure to use the directory from /etc/passwd)

If it comes back ad says something like "No such file or directory" then somewhere in the process, the directory was not created

I'm not sure why someone brought up the automounter stuff so early in the discussion, but you are several steps away from checking that.  If you disable it without even knowing if that is the problem, then you may impact other users on the machine.

Let us know the results of this test, and we can give you more advice on the fix.

Good Luck!
yongsingAuthor Commented:

The directory was created, and I am able to go into it. The /etc/passwd file also has it.
When you do

su - oracle

and it says "no directory"

What does


Is the directory owned by the oracle user?

and are the other permissions set correctly?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
yongsingAuthor Commented:
Tintin, "pwd" will just print out the current directory that I am in, and it is definitely no /export/home/oracle.

if you do a ;

cd /export/home/oracle

and then do

ls -l

what does it say??
yongsingAuthor Commented:
So far I have login as root, and done everything as root.

When I cd to /export/home, and do "ls -l", i have this for oracle directory:

drwxr-xr-x 3 oracle oinstall 512 Jul 11 18:32 oracle

When I cd to /export/home/oracle, and do "ls -l", I have this:

drwxr-xr-x 2 oracle oinstall 512 Jul 11 18:32 Desktop
-rx-r--r-- 1 oracle oinstall 136 Jul 11 18:32 local.cshrc
-rx-r--r-- 1 oracle oinstall 157 Jul 11 18:32 local.login
-rx-r--r-- 1 oracle oinstall 174 Jul 11 18:32 local.profile
Assuming Solaris <=9


/etc/init.d/autofs stop
su - oracle
/etc/init.d/autofs start
Could you post the oracle line from /etc/passwd ?

and I should have said "ls -la" in the /export/home/oracle directory.

yongsingAuthor Commented:
>>Could you post the oracle line from /etc/passwd ?

It has /export/home/oracle as home directory for "oracle".

>> and I should have said "ls -la" in the /export/home/oracle directory.

drwxr-xr-x 3 oracle oinstall 512 Jul 11 18:32 .
drwxr-x--- 4 root   root     512 Jul 11 18:32 ..
-rw-r--r-- 1 oracle oinstall 144 Jul 11 18:32 .profile
drwxr-xr-x 2 oracle oinstall 512 Jul 11 18:32 Desktop
-rw-r--r-- 1 oracle oinstall 136 Jul 11 18:32 local.cshrc
-rw-r--r-- 1 oracle oinstall 157 Jul 11 18:32 local.login
-rw-r--r-- 1 oracle oinstall 174 Jul 11 18:32 local.profile
yongsingAuthor Commented:
The command "uname -r" returns "5.10". This is Solaris 10, right?
SunOS 5.10 is indeed Solaris 10.

In which case, the equivalent of my Solaris <=9 commands are

svcadm disable autofs
su - oracle
svcadm enable autofs
yongsingAuthor Commented:
I did "svcadm disable autofs", and follow by "su - oracle", but I still get the same "No directory!" error.
yongsingAuthor Commented:
Hi guys,

Mystery solved. The permission of /export/home is like this: drwxr-x---. When changed to drwxr-xr-x, the "su - oracle" command works!
So you mustn't have any other users on the system, otherwise you would have discovered they all had the same problem.

Any idea of who changed permission on /export/home?
yongsingAuthor Commented:
I don't know. It is a server that is supposed to be for development works, but I guess nobody has really come to use it yet.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.