我正在尝试连接到Google上的VM。我创建了一个用于SSH的公钥,并将密钥添加到云实例中。我已经将SSH_AUTH_SOCK设置为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一切似乎都很正常:
% ssh-add -L
ssh-rsa AAAAB3NzaC1yc2EA... (none)然而,当我试图真正连接到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).
%发布于 2020-04-15 02:42:04
因此,显然我需要将公钥添加到服务器端的~/.ssh/authorized_keys中。最初,我通过基于网络的管理控制台添加了密钥,并在一个名为"SSH键“的部分添加了该密钥。我还是不知道为什么那看起来不管用。
https://serverfault.com/questions/1012182
复制相似问题