如何使用来自 Amazon EC2 的 .pem 文件和 mosh?

如何使用来自 Amazon EC2 的 .pem 文件和 mosh?

要登录ssh我执行以下操作:

ssh -i ~/.ssh/kp1.pem [email protected]

我尝试了所有这些mosh

mosh --ssh='ssh -i ~/.ssh/kp1.pem [email protected]'

mosh -i ~/.ssh/kp1.pem [email protected]

但我收到了错误:

/usr/bin/mosh: could not get canonical name for /home/$USER/.ssh/kp1.pem: Name or service not known
ssh_exchange_identification: Connection closed by remote host
/usr/bin/mosh: Did not find remote IP address (is SSH ProxyCommand disabled?).

答案1

我最终需要运行如下命令:

mosh --ssh="ssh -i ~/.ssh/kp1.pem" [email protected]

这可行,但我还需要在安全组下的 EC2 管理控制台中添加运行60001端口的规则。mosh

相关内容