I have some files that nobody
needs read access to and apache
needs read and write access to.
Should I do
chown nobody.apache file
chmod 460 file
or
chown apache.nobody file
chmod 640 file
or perhaps something else?
I have some files that nobody
needs read access to and apache
needs read and write access to.
Should I do
chown nobody.apache file
chmod 460 file
or
chown apache.nobody file
chmod 640 file
or perhaps something else?
Based on your comment about secret certificates, you should definitely create a separate user to run OpenVPN (one called "openvpn
" might be a good choice). The nobody
user is (like Kyle Smith said) used as a general-purpose restricted access user, and you might be unwittingly giving access to your OpenVPN certificates to, say, anonymous FTP users.
I'd be inclined to solve the index.txt
problem by adding the apache
user to the openvpn
group and make the file group-readable.
So:
openvpn
userusermod --append --groups openvpn apache
chown openvpn:openvpn /path/to/certificates /path/to/index.txt
chmod 600 /path/to/certificates
chmod 640 /path/to/index.txt
The first one does not make much sense, as usually the user should be the one with more rights, and the user can still change the rights of its own files (this is not what you want).
So, expecting nobody
is the only user of the nobody
group, you should go for your 2nd solution:
chown apache:nobody file
chmod 640 file