我正在尝试使用SSH连接到AWS服务器。但是由于某种原因,我不能。当我在下面跑步时:ssh -i <keypair.pem> ec2-user@<ip> -vvv
我得到:OpenSSH_7.6p1 Ubuntu-4, OpenSSL 1.0.2n 7 Dec 2017debug1: Reading configuration data /etc/ssh/ssh_configdebug1: /etc/ssh/ssh_config line 19: Applying options for *debug2: resolving "<ip>" port 22debug2: ssh_connect_direct: needpriv 0debug1: Connecting to <ip> [<ip>] port 22.debug1: Connection established.debug1: key_load_public: No such file or directorydebug1: identity file <keypair.pem> type -1debug1: key_load_public: No such file or directorydebug1: identity file <keypair.pem>-cert type -1debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4
我猜这是路由器IP禁止配置问题?我能做什么?

最佳答案

检查远程.ssh目录的权限和内容。您的公钥是否在authorized_keys文件中?见以下链接

  • https://en.wikibooks.org/wiki/OpenSSH/Logging_and_Troubleshooting
  • http://www.oracle.com/technetwork/systems/unix/ssh-auth-keys-jsp-135687.html
  • https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server
  • 关于ssh - 无法通过SSH连接到服务器,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50635347/

    10-15 13:34