I have several remote machines that need to pull from a repo after I've completed testing and ready to make updates to production (python Flask app and supporting classes). A couple of the machines need to pull from a different branch, as well. I've been SSHing to each machine to run the git pull, but this is getting annoying and time consuming.
I'm trying to run an ssh command that completes a git pull. This is what I've tried:
ssh dev@<remote IP> "cd /home/dev/<repo> && git pull"
Permission denied (publickey).
fatal: Could not read from remote repository.
ssh dev@<remote IP> "cd /home/dev/<repo> && git remote -v"
From what I understood with your issue, here is my suggestion : [ Information is somewhat incomplete though ]
GIT reads your id_rsa.pub in root user directory : /home/root/.ssh/id_rsa.pub
That's why your key in /home/your_username/.ssh/id_rsa.pub might not be read by git.
Hence, please check and create the key in /home/root/.ssh/
$ sudo su $ ssh-keygen $ cd ~/.ssh $ cat id_rsa.pub
Hope it helps.