[英]SSH & SCP between two EC2 instances times out
I would like to transfer/tunnel between two Amazon EC2 instances via ssh
and scp
(from A to B, as shown below).我想通过ssh
和scp
(从 A 到 B,如下所示)在两个 Amazon EC2 实例之间传输/隧道。
Both instances are running Ubuntu 18.04.两个实例都运行 Ubuntu 18.04。
Run on Instance A:在实例 A 上运行:
$ ssh-keygen -t rsa -b 4096
/home/ubuntu/.ssh/id_rsa
and /home/ubuntu/.ssh/id_rsa.pub
结果放在/home/ubuntu/.ssh/id_rsa
和/home/ubuntu/.ssh/id_rsa.pub
$ chmod 400 /home/ubuntu/.ssh/id_rsa.pub
/home/ubuntu/.ssh/id_rsa.pub
contents复制/home/ubuntu/.ssh/id_rsa.pub
内容Run on Instance B:在实例 B 上运行:
$ sudo vim /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
/home/ubuntu/.ssh/id_rsa.pub
from Instance A to /home/ubuntu/.ssh/authorized_keys
将/home/ubuntu/.ssh/id_rsa.pub
从实例 A 复制的内容附加到/home/ubuntu/.ssh/authorized_keys
Now, testing from A to B:现在,从 A 到 B 进行测试:
ubuntu@ip-XX-XX-XX-XX:~$ ssh -T ubuntu@ec2-34-199-133-209.compute-1.amazonaws.com
ssh: connect to host ec2-34-199-133-209.compute-1.amazonaws.com port 22: Connection timed out
ubuntu@ip-XX-XX-XX-XX:~$ touch testfile.txt && \
> scp testfile.txt ubuntu@ec2-34-199-133-209.compute-1.amazonaws.com:/home/ubuntu/
ssh: connect to host ec2-34-199-133-209.compute-1.amazonaws.com port 22: Connection timed out
What am I missing here?我在这里缺少什么? Do I need to change additional file permissions?我需要更改其他文件权限吗?
The issue was with Inbound Rules on the security group that applied to the cluster of instances.问题在于应用于实例集群的安全组上的入站规则。
Solution:解决方案:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.