I have installed a Red Hat 6.8 machine, on which I have installed a certificate on the default keystore 'cacerts' successfully. When trying to invoke a software which is using SSL and is trying to access the keystore 'cacerts' (invoked as applicative user - not root), I receive the following error message: 'java.io.FileNotFoundException: Permission denied'.

From my research online, any user should have access to the 'cacerts' keystore (although the owner of the file is 'root').

  • 1
    What are the permissions on the directory and file? Owned by root:root and with rwxr-xr-x permissions on the directory should allow the user to access the directory contents. Then it depends on the file permissions and selinux. What distro, do you have selinux enforcing? If so, what is the selinux context shown by 'ls -lZ <filename>'
    – Kyle H
    Jan 30, 2017 at 13:24
  • Group and owner is root (root:root), folder permission is drwxr-xr-x (only read permission should be needed).
    – Guy Tabak
    Jan 30, 2017 at 14:27
  • * Increasing file permission to 777 solved the issue. Thanks for your help.
    – Guy Tabak
    Jan 30, 2017 at 14:28

2 Answers 2


Use sudo. That prevents permission escalation


Increasing file permission to 777 solved the issue.

  • 2
    Never, I repeat, NEVER set your file permissions to 777. This introduces a lot of security risks. You are basically opening up the file to be modified and executed by anyone who can access the server.
    – Odyssee
    Oct 30, 2018 at 8:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .