要登录ssh
我这样做:
ssh -i ~/.ssh/kp1.pem ubuntu@ec2-xxxx.com
Run Code Online (Sandbox Code Playgroud)
我尝试了所有这些mosh
:
mosh --ssh='ssh -i ~/.ssh/kp1.pem ubuntu@ec2-xxxx.com'
mosh -i ~/.ssh/kp1.pem ubuntu@ec2-xxxx.com
Run Code Online (Sandbox Code Playgroud)
但我收到错误:
/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?).
Run Code Online (Sandbox Code Playgroud)
我最终需要像这样运行命令:
mosh --ssh="ssh -i ~/.ssh/kp1.pem" ubuntu@ec2-xxxx.com
Run Code Online (Sandbox Code Playgroud)
这有效,但我还需要为端口添加规则,60001
以便mosh
在安全组下的 EC2 管理控制台中运行。