0

I'm trying to run Java on my web server (that is only rented). I downloaded the JRE from java.com and unpacked it in a local folder in my home directory.

I changed the permissions of the bin/java executable to be able to execute it. The permissions currently are -rwxrwxrwx on the file. So basically 777 just to be sure that the permissions are correct.

But if I want to execute it I always get the following error: -bash: ./java: Permission denied

Is there any chance to get Java running? Is the provider able to disallow the user to run any executables in his home directory?

Thanks for your help!

2
  • what is the mount option for the device that the home is in. Please use df --output=source /some/path/bin/java to find the device. and then mount | grep 'DEVICE name from previouse command' and update the question with the mount options.
    – binarysta
    Sep 12 '20 at 22:29
  • I cannot run df, I also get permission denied there ..
    – beeef
    Sep 12 '20 at 22:46
0

So basically 777 just to be sure that the permissions are correct.

There is so much wrong with that phrase... 777 are -almost always- the wrong permissions. 777 would let anyone execute the program, but 755 would have worked perfectly as well.

Is the provider able to disallow the user to run any executables in his home directory?

Yes. If they mount the home directories with noexec flag they can produce the behavior you are seeing (mount command may show you the mount flags, if you're not too constrained).

You may be able to work around it with a command such /lib64/ld-linux-x86-64.so.2 bin/java

It's also possible that the permission denied is for one of the libraries your java binary depends on.

6
  • I'm not sure which of the listet mounts is my home drive, but there is one with a noexec flag. Your workaround doen't work either. Damn.
    – beeef
    Sep 12 '20 at 22:47
  • So I may have to ask the provider if there's any chance to get Java running on my server?
    – beeef
    Sep 12 '20 at 22:47
  • You may want to check first with something simpler, like cp -v /bin/true .; ./true but yes, you may need to ask the provider. They will probably install it on the system from the package repositories. I wonder why you need a local java program on your web server, though.
    – Ángel
    Sep 12 '20 at 22:50
  • -bash: ./true: Permission denied
    – beeef
    Sep 12 '20 at 22:53
  • 1
    Seems your home is indeed noexec
    – Ángel
    Sep 12 '20 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.