Eu tento executar o script bush com git pull
mas tem permissão negada.
Corre:
sudo bash ./script.sh
Roteiro:
echo -n "Would you like to do "git pull" ("y" or "n", default: "n"): "
read answer
if [ "$answer" = "y" ]; then
if ! git pull origin master; then
echo "Pull conflicts!"
exit
fi
fi
E tem:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Pull conflicts!
Acesso direto à chave ssh:
drwx------ 2 ubuntu ubuntu 4096 Dec 13 02:32 .
drwxr-xr-x 8 ubuntu ubuntu 4096 Dec 13 02:05 ..
-rw------- 1 ubuntu ubuntu 390 Oct 8 07:13 authorized_keys
-rw------- 1 ubuntu ubuntu 1679 Dec 13 01:58 id_rsa
-rw-r--r-- 1 ubuntu ubuntu 405 Dec 13 01:58 id_rsa.pub
-rw------- 1 ubuntu ubuntu 1767 Dec 13 02:16 known_hosts
Como consertar isso?
P.S. Quando eu corro git pull origin master
no terminal - tudo está OK
Respostas:
1 para resposta № 1Chaves privadas SSH 400 em vez de 600. (Chmod 400 id_rsa). Além disso, você está executando como sudo, o que atrapalha seu caminho SSH.