Either provide instructions or find a technical solution to add github (or wherever the private repo is hosted) to the known_hosts file for the apache user during the initial clone.
For right now, in CentOS 7 with PHP installed via SCL, it can be resolved by populating this file:
/opt/rh/httpd24/root/usr/share/httpd/.ssh/known_hosts
with this (if on GitHub):
github.com,192.30.255.113 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
And running
chown -R apache /opt/rh/httpd24/root/usr/share/httpd/.ssh
chmod -R 700 /opt/rh/httpd24/root/usr/share/httpd/.ssh
Comments
Comment #2
joecorall commentedComment #3
joecorall commented