This discussion is archived
1 2 Previous Next 21 Replies Latest reply: May 25, 2011 6:30 AM by rajeysh RSS

unable to su - oracle su: warning: cannot change directory to /home/oracle:

rajeysh Guru
Currently Being Moderated
[root@localhost ~]# su - oracle
su: warning: cannot change directory to /home/oracle: Permission denied
su: /bin/bash: Permission denied

my operating system
[root@localhost ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.1 (Tikanga)
[root@localhost ~]#

[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.18-53.el5PAE #1 SMP Wed Oct 10 16:48:18 EDT 2007 i686 i686 i386 GNU/Linux
[root@localhost ~]#

please help us to resolve it.
  • 1. Re: unable to su - oracle su: warning: cannot change directory to /home/oracle:
    Dude! Guru
    Currently Being Moderated
    You may have wrong permissions of the home directory. Please provide the following output:
    # ls -lad /home/oracle/{.*,*}
  • 2. Re: unable to su - oracle su: warning: cannot change directory to /home/oracle:
    rajeysh Guru
    Currently Being Moderated
    [root@localhost ~]# su - oracle
    su: warning: cannot change directory to /home/oracle: Permission denied
    su: /bin/bash: Permission denied
    [root@localhost ~]# ls -lad /home/oracle/{.*,*}

    drwxr-xr-x 18 oracle oinstall     4096 May 25 12:48 /home/oracle/.
    drwxr-xr-x  7 root   root         4096 May 24 17:07 /home/oracle/..
    -rw-r--r--  1 oracle oinstall    13587 May 24 13:15 /home/oracle/.bash_history
    -rw-r--r--  1 oracle oinstall       24 Feb 18 17:15 /home/oracle/.bash_logout
    -rw-r--r--  1 oracle oinstall      793 Mar 29 14:16 /home/oracle/.bash_profile
    -rw-r--r--  1 oracle oinstall      124 Feb 18 17:15 /home/oracle/.bashrc
    drwxr-xr-x  3 oracle oinstall     4096 Feb 18 19:10 /home/oracle/.config
    drwxr-xr-x  3 oracle oinstall     4096 Mar 21 10:49 /home/oracle/Desktop
    -rw-r--r--  1 oracle oinstall       26 Feb 18 17:33 /home/oracle/.dmrc
    -rw-r--r--  1 oracle oinstall  1975523 May 10 18:14 /home/oracle/ebaodev_ora_983192.out
    -rw-r--r--  1 oracle oinstall 18102950 May  5 15:04 /home/oracle/ebaodev_ora_983192.trc
    drwxr-xr-x  2 oracle oinstall     4096 Feb 18 17:33 /home/oracle/.eggcups
    -rw-r--r--  1 oracle oinstall      515 Feb 18 17:15 /home/oracle/.emacs
    -rw-r--r--  1 oracle oinstall       16 Feb 21 11:29 /home/oracle/.esd_auth
    drwxr-xr-x  4 oracle oinstall     4096 Mar 21 10:49 /home/oracle/.gconf
    drwxr-xr-x  2 oracle oinstall     4096 Mar 21 14:10 /home/oracle/.gconfd
    drwxr-xr-x  3 oracle oinstall     4096 Feb 18 17:33 /home/oracle/.gnome
    drwxr-xr-x  8 oracle oinstall     4096 Mar 21 10:49 /home/oracle/.gnome2
    drwxr-xr-x  2 oracle oinstall     4096 Feb 18 17:33 /home/oracle/.gnome2_private
    drwxr-xr-x  2 oracle oinstall     4096 Feb 18 17:33 /home/oracle/.gstreamer-0.10
    -rw-r--r--  1 oracle oinstall       88 Feb 18 17:33 /home/oracle/.gtkrc-1.2-gnome2
    -rw-r--r--  1 oracle oinstall      758 Mar 21 10:49 /home/oracle/.ICEauthority
    drwxr-xr-x  3 oracle oinstall     4096 Feb 18 17:15 /home/oracle/.kde
    -rw-r--r--  1 oracle oinstall       35 Mar  3 23:13 /home/oracle/.lesshst
    drwxr-xr-x  3 oracle oinstall     4096 Feb 18 17:33 /home/oracle/.metacity
    drwxr-xr-x  3 oracle oinstall     4096 Feb 23 11:38 /home/oracle/.mozilla
    drwxr-xr-x  3 oracle oinstall     4096 Mar 21 10:49 /home/oracle/.nautilus
    -rw-r--r--  1 oracle oinstall      746 Feb 23 16:59 /home/oracle/.recently-used
    -rw-r--r--  1 oracle oinstall    26480 Mar 21 10:49 /home/oracle/.recently-used.xbel
    drwxr-xr-x  3 oracle oinstall     4096 Feb 18 17:33 /home/oracle/.redhat
    -rw-r--r--  1 oracle oinstall        0 Apr 22 15:26 /home/oracle/sathish
    -rw-r--r--  1 oracle oinstall      148 Apr 20 21:01 /home/oracle/ss
    -rw-r--r--  1 oracle oinstall        0 Apr 22 15:29 /home/oracle/ssss
    -rw-r--r--  1 oracle oinstall        0 Apr 22 15:29 /home/oracle/ssssss
    -rw-r--r--  1 oracle oinstall    12288 Apr 20 21:12 /home/oracle/.ss.swp
    -rw-r--r--  1 oracle oinstall    41529 Feb 22 18:21 /home/oracle/testing.txt
    -rw-r--r--  1 oracle oinstall      146 Apr 22 16:04 /home/oracle/test.sh
    drwxr-xr-x  3 oracle oinstall     4096 Feb 18 18:56 /home/oracle/.thumbnails
    drwxr-xr-x  7 oracle oinstall     4096 Mar  4 13:06 /home/oracle/.Trash
    -rw-r--r--  1 oracle oinstall     8475 Apr 22 16:06 /home/oracle/.viminfo
    -rw-r--r--  1 oracle oinstall      918 Mar 21 10:49 /home/oracle/.xsession-errors
    -rw-r--r--  1 oracle oinstall      658 Feb 18 17:15 /home/oracle/.zshrc
    thank you dude.

    Edited by: rajeysh on May 25, 2011 2:05 PM
  • 3. Re: unable to su - oracle su: warning: cannot change directory to /home/oracle:
    Dude! Guru
    Currently Being Moderated
    That looks ok to me. What about the following:
    # ls -l /bin/bash
    # ls -l / | grep bin
    cat /etc/passwd | grep oracle
  • 4. Re: unable to su - oracle su: warning: cannot change directory to /home/oracle:
    Dude! Guru
    Currently Being Moderated
    Another questions: Is this happening only with "su" or also when you login as user Oracle normally?

    You might also want to check if the problem is caused by SELINUX - this should actually be reported in /var/log/messages.

    What happens after you type: setenforce 0

    Does the problem persist? If the problem is solved and you want to continue SELINUX, which his not recommended by Oracle according to the installation documentation, you may have to change the security context of the file in question:

    chcon -t unconfined_t /bin/bash

    Edited by: Dude on May 25, 2011 2:07 AM
  • 5. Re: unable to su - oracle su: warning: cannot change directory to /home/oracle:
    Nik Expert
    Currently Being Moderated
    Hi!
    Please show result for:

    df -k /home/oracle
    ls -lad /home
    ls -lad /oracle

    Regards.
  • 6. Re: unable to su - oracle su: warning: cannot change directory to /home/oracle:
    rajeysh Guru
    Currently Being Moderated
    [root@localhost ~]# setenforce 0
    setenforce: SELinux is disabled
    [root@localhost ~]# ls -l /bin/bash
    -rwxrwxr-x 1 root root 722684 Jul 12  2006 /bin/bash
    [root@localhost ~]# ls -l / | grep bin
    drwxrwxr-x   2 root   root      4096 May 25 13:57 bin
    drwxr-xr-x   2 root   root     12288 Feb 18 18:23 sbin
    [root@localhost ~]# cat /etc/passwd | grep oracle
    oracle:x:500:501::/home/oracle:/bin/bash
    [root@localhost ~]#
    
    [root@localhost ~]# chcon -t unconfined_t /bin/bash
    chcon: can't apply partial context to unlabeled file /bin/bash
    [root@localhost ~]#
    i am trying to access the server using putty.

    when i try to login as oracle user (su) or other user eg:nic it gives me the same error message for any user.

    when i give username oracle and password the putty immediately closed.

    Edited by: rajeysh on May 25, 2011 2:39 PM
  • 7. Re: unable to su - oracle su: warning: cannot change directory to /home/oracle:
    rajeysh Guru
    Currently Being Moderated
    [root@localhost Desktop]# df -k /home/oracle
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00
                         275453944 256595432   4640480  99% /
    [root@localhost Desktop]# ls -lad /home
    drwxrwxr-x 7 root root 4096 May 24 17:07 /home
    [root@localhost Desktop]# ls -lad /oracle
    ls: /oracle: No such file or directory
    [root@localhost Desktop]# ls -lad /home/oracle
    drwxr-xr-x 18 oracle oinstall 4096 May 25 12:48 /home/oracle
    thanks
  • 8. Re: unable to su - oracle su: warning: cannot change directory to /home/oracle:
    Dude! Guru
    Currently Being Moderated
    Permissions of the /bin directory and all files should actually be 755, not 775. Your system disk is full.

    Very strange indeed. Anything in /var/log/messages?

    Edited by: Dude on May 25, 2011 2:15 AM
  • 9. Re: unable to su - oracle su: warning: cannot change directory to /home/oracle:
    Nik Expert
    Currently Being Moderated
    Hi.
    please:

    ls -lad /
  • 10. Re: unable to su - oracle su: warning: cannot change directory to /home/oracle:
    rajeysh Guru
    Currently Being Moderated
    [root@localhost Desktop]# ls -lad /
    d------r-- 26 root root 4096 May 21 08:12 /
  • 11. Re: unable to su - oracle su: warning: cannot change directory to /home/oracle:
    Dude! Guru
    Currently Being Moderated
    Credit to Nik. That should be 755:

    drwxr-xr-x 23 root root 4096 2011-05-23 14:11 /
  • 12. Re: unable to su - oracle su: warning: cannot change directory to /home/oracle:
    rajeysh Guru
    Currently Being Moderated
    [oracle@localhost ~]$ su - oracle
    Password:
    su: cannot set groups: Operation not permitted
    [oracle@localhost ~]$ su - nic
    Password:
    su: cannot set groups: Operation not permitted
    [oracle@localhost ~]$
  • 13. Re: unable to su - oracle su: warning: cannot change directory to /home/oracle:
    Nik Expert
    Currently Being Moderated
    Hi
    ls -la /etc/group
    ls -lad /etc
    ls -la /bin/su

    Regards.
  • 14. Re: unable to su - oracle su: warning: cannot change directory to /home/oracle:
    rajeysh Guru
    Currently Being Moderated
    [oracle@localhost u01]$ ls -lad /etc
    drwxr-xr-x 102 root root 12288 May 25 12:41 /etc
    [oracle@localhost u01]$ ls -lad /etc/group
    -rwxr-xr-x 1 root root 760 May 25 12:15 /etc/group
    [oracle@localhost u01]$ ls -la /bin/su
    -rwxr-xr-x 1 root root 24060 Nov 27  2006 /bin/su
    [oracle@localhost u01]$
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points