I'm installing SSL certificate on a VPS server. I need to make it only readable by the root. How can I do this?
migrated from stackoverflow.com Aug 19 '12 at 5:05
This question came from our site for professional and enthusiast programmers.
where cert.key is the filename.
The first command makes sure root is the owner of the file.
The three numbers in the chmod command correspond to the permissions for the user (root, in this case), group, and everybody else, respectively. The permission values are 4 for reading, 2 for writing, and 1 for executing. In this case, the chmod command gives root permission to read and write the file (4 + 2 = 6), and nobody else permission to do anything.