权限被拒绝(公钥) - AWS 上的 bitnami(Wordpress 网站) - 与 PC 连接

权限被拒绝(公钥) - AWS 上的 bitnami(Wordpress 网站) - 与 PC 连接

当我尝试使用 PowerShell 或 Cygwin 从我的 PS 连接到托管我的 Wordpress 网站(Bitnami)的 AWS 时,遇到以下问题。

(我只是想通过这种方式或使用 Putty 登录到服务器,如下所述([LINK][1]油灰抛出错误“使用用户名 bitnami。服务器拒绝我们的密钥。没有可用的受支持的身份验证方法。服务器发送了公钥“)

我目前尝试过的方法是:我执行以下任一命令或同时执行以下两个命令...

chmod 600 <key-pair-from-aws>.pem
chmod 400 <key-pair-from-aws>.pem

(当我登录到 ec2 实例时,在“密钥对”部分下我看到了一个条目,但我无法下载它。这就是我生成新密钥对的原因,这就是我在下面的命令中使用的文件。)

然后我输入以下命令...

ssh bitnami@<public-ip-address> -i <key-pair-from-aws>.pem

...我收到以下错误:

'(key-pair-from-aws).pem' 的权限太开放。要求您的私钥文件不能被其他人访问。此私钥将被忽略。加载密钥“.pem”:权限错误 bitnami@(public-ip-address):权限被拒绝 (publickey)。

现在,如果我在 PC 上选择文件“属性 -> 安全 -> 高级 -> 禁用继承”,然后删除除我的用户之外的每个用户,然后执行相同的命令...

ssh bitnami@<public-ip-address> -i <key-pair-from-aws>.pem

...我收到以下错误:

bitnami@<public-ip-address>: Permission denied (publickey).

我在这里卡住了,因为我不知道如何继续。在 Stackoverflow 和 Google 上搜索后,我找不到任何可以帮助我解决这个问题的东西。

有人能帮忙提供具体的分步说明吗?谢谢!

更新:这是命令 $ ssh -v -i "pem-file-name.pem" bitnami@ 的结果

> OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug1: Connecting to <public-ip-address> [<public-ip-address>] port 22.
debug1: Connection established.
debug1: identity file kljuc_par_ime.pem type -1
debug1: identity file kljuc_par_ime.pem-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.4p1 Debian-
5+deb11u1
debug1: match: OpenSSH_8.4p1 Debian-5+deb11u1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to <public-ip-address>:22 as 'bitnami'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit>
compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit>
compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: <deleted for sec purposes> SHA256:<deleted for security purposes>
debug1: Host '<public-ip-address>' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\My-User/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: Will attempt key: kljuc_par_ime.pem  explicit
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected]
m,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp38
4,ecdsa-sha2-nistp521,[email protected],webauthn-sk-ecdsa-sha2-ni
[email protected]>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: kljuc_par_ime.pem
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
bitnami@<public-ip-address>: Permission denied (publickey)

相关内容