9 Replies Latest reply: Aug 12, 2011 3:55 AM by 881229 RSS

    Unable to execute /bin/ commands as other user

    881229
      I logged in as a user 'abc' and when I am trying to execute any executable from /bin/ . I get the permission denied error.

      for example:

      when I am trying to do the
      $man find

      this throws an error 'Permission Denied'

      Will the root user be able to provide the necessary permissions to the 'abc' user to access the binary/ executable files?
      If yes, how?
        • 1. Re: Unable to execute /bin/ commands as other user
          Nik
          Hi.

          Please show result of commands:

          ls -lad /
          ls -lad /bin
          ls -lad /usr
          ls -lad /usr/bin
          ls -lad /usr/bin/man


          Result should be:
          # ls -lad /
          drwxr-xr-x  37 root     root        1024 Jun 20 17:04 /
          # ls -lad /bin    
          lrwxrwxrwx   1 root     root           9 Aug 17  2009 /bin -> ./usr/bin
          # ls -lad /usr
          drwxr-xr-x  39 root     sys         1024 Nov  8  2010 /usr
          # ls -lad /usr/bin
          drwxr-xr-x   5 root     bin        12800 Oct 21  2009 /usr/bin
          # ls -lad /usr/bin/man
          -r-xr-xr-x   4 root     bin        29568 Apr  7  2002 /usr/bin/man
          use chmod for set correct permissions.

          Other way for restore all permissions:
          pkgchk -f

          But you can't control this proces.


          Regards.
          • 2. Re: Unable to execute /bin/ commands as other user
            881229
            oracle> ls -lad /
            drwxr-xr-x 26 root root 1024 Aug 11 10:02 /
            oracle> ls -lad /bin
            lrwxrwxrwx 1 root root 9 Sep 5 2002 /bin -> ./usr/bin
            oracle> ls -ladls -lad /usr
            2 drwxr-xr-x 32 root sys 1024 Mar 23 2005 /usr
            oracle> ls -lad /usr/bin
            drwxr-xr-x 4 root bin 9216 May 15 2010 /usr/bin
            oracle> ls -lad /usr/bin/man
            -r-xr-xr-x 4 root bin 29568 Apr 6 2002 /usr/bin/man

            So wht is the next step ? How do I resolve this?
            • 3. Re: Unable to execute /bin/ commands as other user
              Nik
              Hi.

              Infirst post you write:
              >I logged in as a user 'abc' and when I am trying to execute any executable from /bin/ . I get the permission denied error.
              But after you show that for some users it works:
              > oracle> ls -lad /usr/bin

              So please clarify:
              This problem for specific user or for all users ? What shell used for users that have problem ?
              This problem for any programs from /bin or for specif set of the program?


              Regards.
              • 4. Re: Unable to execute /bin/ commands as other user
                881229
                I am sorry .. I was actually giving an example 'abc' user ..
                It is in actual the oracle user.


                oracle> echo $SHELL
                /bin/ksh

                This is the shell the oracle user is using .. I have no idea abt other users as I dnt have access.

                And btw I tried nly for the executable files in /bin
                • 5. Re: Unable to execute /bin/ commands as other user
                  abrante
                  .. well, the "ls" command you just used is (normally) in the same directory as the "man" command you described in your first post, so i would suggest that you run the following two commands next:

                  which man
                  ls -l /usr/bin/man

                  Also, does the "permission denied" message return a path? It looks like a bash/sh error, and should in that case say something like:

                  bash /usr/bin/man: Permission denied

                  .. in other words, whats the exact error?

                  .7/M.
                  • 6. Re: Unable to execute /bin/ commands as other user
                    881229
                    oracle> which man
                    Warning: cannot determine current directory
                    /usr/bin//man


                    oracle> ls -l /usr/bin/man
                    -r-xr-xr-x 4 root bin 29568 Apr 6 2002 /usr/bin/man

                    Aww .. I see that the path is not proper .. Am I right? If yes, how do I set this?
                    • 7. Re: Unable to execute /bin/ commands as other user
                      Nik
                      Hi.

                      Path is correct.

                      /bin - just link to /usr/bin

                      So problem not with any commands from /bin . Currently not work man.


                      It's not normal:
                      Warning: cannot determine current directory
                      Please show result of
                      pwd
                      cd /
                      pwd
                      man ls
                      echo $HOME
                      ls -lad $HOME
                      Regards
                      • 8. Re: Unable to execute /bin/ commands as other user
                        881229
                        oracle> pwd
                        /home/oracle
                        oracle> cd /
                        oracle> man ls

                        User Commands ls(1)

                        NAME
                        ls - list contents of directory

                        SYNOPSIS
                        /usr/bin/ls [-aAbcCdfFghilLmnopqrRstux1@] [file...]

                        /usr/xpg4/bin/ls [-aAbcCdfFghilLmnopqrRstux1@] [file...]

                        DESCRIPTION
                        For each file that is a directory, ls lists the contents of
                        the directory. For each file that is an ordinary file, ls
                        repeats its name and any other information requested. The
                        output is sorted alphabetically by default. When no argument
                        is given, the current directory is listed. When several
                        arguments are given, the arguments are first sorted
                        appropriately, but file arguments appear before directories
                        and their contents.

                        There are three major listing formats. The default format

                        oracle> echo $HOME
                        /home/oracle
                        oracle> ls -lad $HOME
                        drwxr-xr-x 6 oracle dba 1024 Aug 12 02:32 /home/oracle
                        • 9. Re: Unable to execute /bin/ commands as other user
                          881229
                          Thanks guys !!

                          The problem is solved now ..

                          Well .. I actually wanted to run the command:
                          oracle>find /home/oracle/dmps -name '*' -mtime +20;

                          And I am actually running it from ORACLE Home Dir ..
                          I suppose it doesn't have enough permissions to access the find file.

                          Hence, the next thing I did was this:

                          oracle> cd /
                          oracle> find /home/oracle/dmps -name '*' -mtime +20;
                          /home/oracle/dmps/Jul20.dmp.Z
                          /home/oracle/dmps/Jul21.dmp.Z
                          /home/oracle/dmps/21.dmp.Z
                          /home/oracle/dmps/Jul22.dmp.Z

                          Now it worked .. :)