Tento fazer ssh do meu host local para o Cloud Shell do GCP e recebo o erro:
$ gcloud cloud-shell ssh --authorize-session
sign_and_send_pubkey: signing failed for RSA "/home/kossak/.ssh/google_compute_engine" from agent: agent refused operation
<USER>@<IP>: Permission denied (publickey).
ERROR: (gcloud.cloud-shell.ssh) [/usr/bin/ssh] exited with return code [255].
com opção de depuração:
$ gcloud cloud-shell ssh --authorize-session --verbosity debug
DEBUG: Running [gcloud.cloud-shell.ssh] with arguments: [--authorize-session: "True", --verbosity: "debug"]
DEBUG: Starting new HTTPS connection (1): cloudshell.googleapis.com:443
DEBUG: https://cloudshell.googleapis.com:443 "GET /v1/users/me/environments/default?alt=json HTTP/1.1" 200 None
DEBUG: Starting new HTTPS connection (1): cloudshell.googleapis.com:443
DEBUG: https://cloudshell.googleapis.com:443 "POST /v1/users/me/environments/default:authorize?alt=json HTTP/1.1" 200 None
DEBUG: Running command [/usr/bin/ssh -t -p 6000 -i /home/kossak/.ssh/google_compute_engine -o StrictHostKeyChecking=no <USER>@<IP> -- DEVSHELL_PROJECT_ID=<PROJECT_ID> bash -l].
DEBUG: Executing command: ['/usr/bin/ssh', '-t', '-p', '6000', '-i', '/home/kossak/.ssh/google_compute_engine', '-o', 'StrictHostKeyChecking=no', '<USER>@<IP>', '--', 'DEVSHELL_PROJECT_ID=<PROJECT_ID>', 'bash -l']
sign_and_send_pubkey: signing failed for RSA "/home/kossak/.ssh/google_compute_engine" from agent: agent refused operation
<USER>@<IP>: Permission denied (publickey).
DEBUG: (gcloud.cloud-shell.ssh) [/usr/bin/ssh] exited with return code [255].
Traceback (most recent call last):
File "/home/kossak/apps/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 987, in Execute
resources = calliope_command.Run(cli=self, args=args)
File "/home/kossak/apps/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 807, in Run
resources = command_instance.Run(args)
File "/home/kossak/apps/google-cloud-sdk/lib/surface/cloud_shell/ssh.py", line 114, in Run
command.Run(connection_info.ssh_env)
File "/home/kossak/apps/google-cloud-sdk/lib/googlecloudsdk/command_lib/util/ssh/ssh.py", line 1541, in Run
raise CommandError(args[0], return_code=status)
googlecloudsdk.command_lib.util.ssh.ssh.CommandError: [/usr/bin/ssh] exited with return code [255].
ERROR: (gcloud.cloud-shell.ssh) [/usr/bin/ssh] exited with return code [255].
O que eu já tentei:
- reiniciando o ssh-agent na máquina local
- reiniciando minha máquina local e Cloud Shell
gcloud compute config-ssh
(na máquina local e no Cloud Shell) retornado apenasWARNING: No host aliases were added to your SSH configs because instances have no public IP.
- removendo todas as chaves ssh do GCP Compute => Metadados => Chaves SSH
- renomeando
~/.ssh
e tentando conectar novamente ssh-add -l
retorna ambas as minhas chaves: rsa (do gcp) e ed25519 (criada manualmente)- permissões de
/home/kossak/.ssh
são 700 - permissões de
/home/kossak/.ssh/google_compute_engine
são 600 - conectando-se a outro servidor SSH na minha rede local com uma chave ssh - funciona corretamente
- executando comandos git com autorização de chave ssh (por exemplo
git remote update
) - funciona corretamente
Eu uso:
- Manjar Linux
- SDK do Google Cloud 410.0.0
Posso fazer login no Cloud Shell de outro hostentão o problema provavelmente está no meu computador. Alguém sabe o que há de errado ou como depurá-lo?
Obrigado por qualquer conselho.