I've written an install script on a server to quickly set up new sites in the /srv directory. It needs to do a
git clone, and has to be run via
sudo in order to have the permissions to do all the things it needs to do (create directories in /srv, create a new VirtualHost, restart Apache, etc).
The question I have is simply this: at the moment the root user has no SSH key, but I'll need one in order to
git clone from BitBucket. Are there any security issues with generating one? That is, if I run
ssh-keygen as root so I have public and private keys for the root user, will I be making the server less secure in any way?
Incidentally, this is a script that is already in use and has been working fine, but until now the repo I'm cloning from has been a local one, hosted on the same server. I've recently switched to hosting it remotely (on BitBucket), so I need a "deployment key" in order to git clone it.