上传 SSH 密钥后无法通过 SSH 登录

上传 SSH 密钥后无法通过 SSH 登录

我刚刚将 SSH 密钥上传到我的服务器,现在我无法再登录了... SSH 正在端口 3333 上运行。

油灰:pageant failed to answer challenge

终端尝试时给出以下信息:ssh -vvv "[email protected] -p 3333"

OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to xxx.xxx.xxx.xxx -p 3333 [xxx.xxx.xxx.xxx] port 22.
debug1: connect to address xxx.xxx.xxx.xxx port 22: Connection refused
ssh: connect to host xxx.xxx.xxx.xxx -p 3333 port 22: Connection refused

我跟着本教程

我该如何再次登录?

答案1

把引号去掉。你应该运行

ssh [email protected] -p 3333

需要引号是ssh-copy-id因为ssh-copy-id这只是一个脚本,它本身使用您提供的参数调用 ssh(其中没有[email protected] -p 3333引号),但是直接运行 ssh 时,您不需要引号。

相关内容