LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-02-2013, 07:10 AM   #1
djay_a
LQ Newbie
 
Registered: Sep 2013
Posts: 5

Rep: Reputation: Disabled
./java: Permission denied


Can't figure out the solution. PLease help.

[oracle@chnmct297942d bin]$ pwd
/home/oracle/database/db/tech_st/11.1.0/appsutil/jre/bin
[oracle@chnmct297942d bin]$ ls
ControlPanel java java_vm javaws jcontrol keytool orbd pack200 policytool rmid rmiregistry servertool tnameserv unpack200
[oracle@chnmct297942d bin]$ ./java -version
-bash: ./java: Permission denied
[root@chnmct297942d bin]# ls -ltr
total 740
-rwxrwxrwx. 1 oracle dba 6347 Apr 1 2009 jcontrol
-rwxrwxrwx. 1 oracle dba 76239 Apr 1 2009 javaws
-rwxrwxrwx. 1 oracle dba 24886 Apr 1 2009 java_vm
-rwxrwxrwx. 1 oracle dba 47116 Apr 1 2009 java
-rwxrwxrwx. 1 oracle dba 6347 Apr 1 2009 ControlPanel
-rwxrwxrwx. 1 oracle dba 189268 Apr 1 2009 unpack200

Regards,
 
Old 09-02-2013, 07:46 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,520

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Hi,

Most likely the filesystem where /home/oracle/database/db/tech_st/11.1.0/appsutil/jre/bin exists is mounted with the "noexec" option set.
Try to remount it removing "noexec" and see what happens

Regards
 
Old 09-03-2013, 02:15 AM   #3
djay_a
LQ Newbie
 
Registered: Sep 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
Hi,

Most likely the filesystem where /home/oracle/database/db/tech_st/11.1.0/appsutil/jre/bin exists is mounted with the "noexec" option set.
Try to remount it removing "noexec" and see what happens

Regards
Here are fstab entries

[root@chnmct297942d ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Wed Aug 21 16:43:43 2013
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_chnmct297942d-lv_root / ext4 defaults 1 1
UUID=90affd8f-2bc3-4a6e-978d-01e94cd57751 /boot ext4 defaults 1 2
/dev/mapper/vg_chnmct297942d-lv_home /home ext4 defaults 1 2
/dev/mapper/vg_chnmct297942d-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
 
Old 09-03-2013, 04:00 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,520

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Hi,

From fstab looks like /home is mounted with the usual options, so you should be able to run commands. To verify that defaults are not changed somehow run:
Code:
cat /proc/mounts
Another thing to look at, is SELinux, as I guess you're running an RHEL based distro (because anaconda has created fstab). Try to disable it temporarily
Code:
setenforce 0
and see if you can run java from your homedir
 
Old 09-03-2013, 06:05 AM   #5
djay_a
LQ Newbie
 
Registered: Sep 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Here you go . ..

[root@chnmct297942d bin]# cat /proc/mounts
rootfs / rootfs rw 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0
devtmpfs /dev devtmpfs rw,seclabel,nosuid,relatime,size=3955588k,nr_inodes=988897,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /dev/shm tmpfs rw,seclabel,nosuid,nodev,relatime 0 0
/dev/mapper/vg_chnmct297942d-lv_root / ext4 rw,seclabel,relatime,barrier=1,data=ordered 0 0
none /selinux selinuxfs rw,relatime 0 0
devtmpfs /dev devtmpfs rw,seclabel,nosuid,relatime,size=3955588k,nr_inodes=988897,mode=755 0 0
/proc/bus/usb /proc/bus/usb usbfs rw,relatime 0 0
/dev/sda1 /boot ext4 rw,seclabel,relatime,barrier=1,data=ordered 0 0
/dev/mapper/vg_chnmct297942d-lv_home /home ext4 rw,seclabel,relatime,barrier=1,data=ordered 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
/etc/auto.misc /misc autofs rw,relatime,fd=7,pgrp=1752,timeout=300,minproto=5,maxproto=5,indirect 0 0
-hosts /net autofs rw,relatime,fd=13,pgrp=1752,timeout=300,minproto=5,maxproto=5,indirect 0 0

Please let me know how to disable SELinux.
 
Old 09-03-2013, 07:25 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,520

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
To disable SELinux temporarily run (as root)
Code:
setenforce 0
 
Old 09-03-2013, 07:29 AM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Having world writable executables is a security failure... Even if it allowed you to execute it.
 
Old 09-03-2013, 07:31 AM   #8
djay_a
LQ Newbie
 
Registered: Sep 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Still same error.

[root@chnmct297942d bin]# setenforce 0
[root@chnmct297942d bin]#
[root@chnmct297942d bin]#
[root@chnmct297942d bin]# su - oracle
[oracle@chnmct297942d bin]$ pwd
/home/oracle/database/db/tech_st/11.1.0/appsutil/jre/bin
[oracle@chnmct297942d bin]$ ./java -version
-bash: ./java: Permission denied
[oracle@chnmct297942d bin]$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (rhel-1.45.1.11.1.el6-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
[oracle@chnmct297942d bin]$ which java
/usr/bin/java
[oracle@chnmct297942d bin]$ ls -l /usr/bin/java
lrwxrwxrwx. 1 root root 22 Sep 2 20:38 /usr/bin/java -> /etc/alternatives/java

Last edited by djay_a; 09-03-2013 at 07:47 AM.
 
Old 09-03-2013, 07:45 AM   #9
djay_a
LQ Newbie
 
Registered: Sep 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jpollard View Post
Having world writable executables is a security failure... Even if it allowed you to execute it.
Hi Pollard,

I understand your concern but this is not production server but using for educational purposes.
 
Old 09-03-2013, 04:51 PM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,520

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Quote:
Still same error.

[root@chnmct297942d bin]# setenforce 0
[root@chnmct297942d bin]#
[root@chnmct297942d bin]#
[root@chnmct297942d bin]# su - oracle
[oracle@chnmct297942d bin]$ pwd
/home/oracle/database/db/tech_st/11.1.0/appsutil/jre/bin
[oracle@chnmct297942d bin]$ ./java -version
-bash: ./java: Permission denied
[oracle@chnmct297942d bin]$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (rhel-1.45.1.11.1.el6-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
[oracle@chnmct297942d bin]$ which java
/usr/bin/java
[oracle@chnmct297942d bin]$ ls -l /usr/bin/java
lrwxrwxrwx. 1 root root 22 Sep 2 20:38 /usr/bin/java -> /etc/alternatives/java
I cannot think for anything else. Maybe some directory upwards is not executable for user oracle.
Can root run ./java from that directory?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
mkdir throws Permission Denied error in a directoy even with root ownership and 777 permission surajchalukya Linux - Security 14 09-03-2012 09:34 AM
can't execute c++ binaries, "permission denied"... even though permission is 777 SerfurJ Programming 14 02-20-2009 05:50 AM
'permission denied" inspite of right permission flags on network drive anirudhvij Linux - Enterprise 8 05-22-2007 06:57 AM
permission denied while installing Java kiphiggins Linux - Security 1 11-27-2006 11:22 PM
java n fc3, error permission denied AVD_ZM Linux - Software 1 05-23-2005 04:46 AM


All times are GMT -5. The time now is 10:31 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration