3

I'm trying to connect to a VM on Google Cloud. I've created a public key to use for SSH and added the key to the cloud instance. I have SSH_AUTH_SOCK set to the file used by gpg-agent.

~/.gnupg/gpg-agent.conf

default-cache-ttl 600
max-cache-ttl 7200
enable-ssh-support
pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
~/.zprofile

...

export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpgconf --launch gpg-agent

Everything seems to be working properly:

% ssh-add -L
ssh-rsa AAAAB3NzaC1yc2EA... (none)

However, when I attempt to actually connect to the VM...

debug1: Offering public key: (none) RSA SHA256:[REDACTED] agent
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/alice/.ssh/id_rsa
debug3: no such identity: /Users/alice/.ssh/id_rsa: No such file or directory
debug1: Trying private key: /Users/alice/.ssh/id_dsa
debug3: no such identity: /Users/alice/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /Users/alice/.ssh/id_ecdsa
debug3: no such identity: /Users/alice/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /Users/alice/.ssh/id_ed25519
debug3: no such identity: /Users/alice/.ssh/id_ed25519: No such file or directory
debug1: Trying private key: /Users/alice/.ssh/id_xmss
debug3: no such identity: /Users/alice/.ssh/id_xmss: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
alice@1.2.3.4: Permission denied (publickey).
%
5nefarious
  • 131
  • 3

1 Answers1

0

So, apparently I needed to add the public key to ~/.ssh/authorized_keys on the server side. I initially added the key through the web-based management console, under a section labelled "SSH Keys." I still don't know why that didn't seem to work.

5nefarious
  • 131
  • 3