AWS SSH 和 RDS 权限被拒绝 - 公钥

咆哮者

我正在尝试SSH连接到我的 RDS 实例。两者都不起作用,给出相同的错误:

权限被拒绝(公钥)。

我已经在以下位置设置了我的凭据~/.ssh/config

Host clg-api-staging
     HostName ec2-11-111-11-11.compute-1.amazonaws.com   
     User ec2-user
     IdentityFile ~/.ssh/clg-api-staging.pem

我试过了:

  • 更改我对pem文件的权限chmod 600 ~/.ssh/clg-api-staging.pem

  • 将我的权限更改~/.ssh/700

  • 为端口22上的TCP 和端口上的MYSQL设置入站规则3306

在此处输入图片说明

这是我尝试通过配置文件登录时的消息:

$ ssh -v clg-api-staging

OpenSSH_7.4p1, LibreSSL 2.5.0
debug1: Reading configuration data /Users/danniu/.ssh/config
debug1: /Users/danniu/.ssh/config line 26: Applying options for clg-api-staging
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to ec2-34-196-57-20.compute-1.amazonaws.com [34.196.57.20] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /Users/danniu/.ssh/clg-api-staging.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/danniu/.ssh/clg-api-staging.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to ec2-34-196-57-20.compute-1.amazonaws.com:22 as 'ec2-user'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
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: ecdsa-sha2-nistp256 SHA256:pATHD/i/BUstt1K3QKzJB4kNJyIQJUoFNpmpsot/5Lg
debug1: Host 'ec2-34-196-57-20.compute-1.amazonaws.com' is known and matches the ECDSA host key.
debug1: Found key in /Users/danniu/.ssh/known_hosts:24
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: Skipping ssh-dss key /Users/danniu/.ssh/id_dsa - not in PubkeyAcceptedKeyTypes
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/danniu/.ssh/github_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/danniu/.ssh/clg-api-staging.pem
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

这是尝试通过 Sequel PRO 连接到 RDS DB 时的消息:

Used command:  /usr/bin/ssh -v -N -S none -o ControlMaster=no -o ExitOnForwardFailure=yes -o ConnectTimeout=10 -o NumberOfPasswordPrompts=3 -i /Users/danniu/.ssh/clg-api-staging.pem -o TCPKeepAlive=no -o ServerAliveInterval=60 -o ServerAliveCountMax=1 [email protected] -L 55318:aa1tgl9qfl015rk.cuqlyug9ccbu.us-east-1.rds.amazonaws.com:3306

OpenSSH_7.4p1, LibreSSL 2.5.0
debug1: Reading configuration data /Users/danniu/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Control socket " none" does not exist
debug1: Connecting to ec2-34-196-57-20.compute-1.amazonaws.com [34.196.57.20] port 22.
debug1: fd 8 clearing O_NONBLOCK
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /Users/danniu/.ssh/clg-api-staging.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/danniu/.ssh/clg-api-staging.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to ec2-34-196-57-20.compute-1.amazonaws.com:22 as 'ec2-user'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
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: ecdsa-sha2-nistp256 SHA256:pATHD/i/BUstt1K3QKzJB4kNJyIQJUoFNpmpsot/5Lg
debug1: read_passphrase: can't open /dev/tty: Device not configured
debug1: permanently_drop_suid: 501
Warning: Permanently added 'ec2-34-196-57-20.compute-1.amazonaws.com,34.196.57.20' (ECDSA) to the list of known hosts.
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: Skipping ssh-dss key /Users/danniu/.ssh/id_dsa - not in PubkeyAcceptedKeyTypes
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/danniu/.ssh/github_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/danniu/.ssh/clg-api-staging.pem
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).
普拉卡什26790

您无法直接通过 SSH 访问 AWS RDS 实例。您可以通过 MySQL 客户端访问它。

  1. 安装 apt-get install MySQL-server -y
  2. 跑步 MySQL -h clg-api-staging -P password -p

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

AWS ssh访问“权限被拒绝(公钥)”问题

AWS OpsWorks SSH直接连接权限被拒绝(公钥)

SSH权限被拒绝(公钥)

ssh权限被拒绝(公钥)

SSH权限被拒绝(公钥)

SSH权限被拒绝(公钥)

SSH连接错误-权限被拒绝(公钥)

rsync:SSH权限被拒绝(公钥)

SSH 时权限被拒绝(公钥)

SSH权限被拒绝(公钥)DigitalOcean Ubuntu

SSH到Docker:权限被拒绝(公钥)

'ssh localhost'给出'权限被拒绝(公钥)。

与SSH混淆-权限被拒绝(公钥)

Github SSH访问:权限被拒绝(公钥)

GitLab SSH密钥-权限被拒绝(公钥)

ssh权限被拒绝(公钥,键盘交互)

Amazon Web Service(AWS)VPC专用子网实例“权限被拒绝(公钥)”。-来自osx的ssh

权限被拒绝(公钥),但公钥在本地和远程存在

更改 ~/.ssh/authorized_keys 和 ~/.ssh 目录的权限后,我得到一个权限被拒绝(公钥)

当我尝试在aws上访问ssh时运行ssh-add之后,我收到“权限被拒绝(公钥)”

vagrant ssh 调用的是 22 而不是 2222?- 权限被拒绝(公钥)

SSH-服务器上的权限被拒绝(公钥)

SSH错误:Ansible中的权限被拒绝(公钥,密码)

EC2 + ssh:权限被拒绝(公钥)

对Google计算引擎VM的SSH权限被拒绝(公钥)

无法SSH到服务器:权限被拒绝(公钥)

无法通过ssh连接到github;权限被拒绝(公钥)

ssh配置不起作用。权限被拒绝(公钥)

Gitlab CI-SSH权限被拒绝(公钥,密码)