I have a private webserver which runs under user 'nobody'. This webserver occasionally needs to access another server using SSH automatically. When this happens, I cannot be present to use a password.
Therefore, I created a file with permission 700 and assigned user nobody (chmod and chown) to it. However, when accessing that file using 'sudo -u nobody cat testfile', I still cannot access the file. I therefore assume I cannot create a rsa_id with correct permissions for the webserver to use.
Is it possible to create a file which can be used by the nobody user, to connect to SSH? If not, is it the next best thing to create a user specifically for the server with a home directory and then use that rsa_id?
PS: I'm on centos
Thanks for reading!