I'm trying to add a key to github and my server so my server can clone from github.
mkdir -p /root/.ssh
chmod 700 /root/.ssh
cat > /root/.ssh/authorized_keys <<EOF
ssh-rsa AAAAB3NzaC1yc2E.... GitHub
EOF
chmod 600 /root/.ssh/authorized_keys
cat > /root/.ssh/github.id_rsa <<EOF
-----BEGIN RSA PRIVATE KEY-----
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-----END RSA PRIVATE KEY-----
EOF
chmod 600 /root/.ssh/github.id_rsa
cat > /root/.ssh/config <<EOF
Host github.com
Hostname github.com
IdentityFile ~/.ssh/github.id_rsa
EOF
chmod 600 /root/.ssh/config
I added the public key to github and when I try and clone it doesn't connect. What am I doing wrong?