ssh [email protected]<<'ENDSSH' cd/home/me/myapp pm2 stop myapp git pull origin master npm install npm run build pm2 start myapp ENDSSH
Problem: at the
git pull origin masterstage, I get an error that I don’t have access rights.
Cloning into'issue'... Permission denied(publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights. and the repository exists.
If I execute this command myself, logging into the server via SSH - everything works! So why does not work when I run through the script? What key is he trying to use?(On the local machine and VPSke different keys for GitHub, but the account is the same)