I'm trying to meet a requirement where devs can log in to a server, launch, and test code without having the ability to pull (or access any ssh keys)code from the repository.
I don't want to grant them access to push or pull from Git.
Currently, I have the root user set up with an SSH key for Git that allows cloning and pulling to /home/luser/myproject.
However, I realize that running these operations as root isn't ideal since I have to change the ownership of the files afterward. But I can't give developers access to these SSH keys. They only need to be able to log in, launch the code, and run their tests.
I am thinking that maybe a cronjob to pull code and then chown the files afterwards, but perhaps there is a recommended practice for this; where users can have access to pulled code, but nothing more.
Is there a recommend practice for this ? Surely there is .