我正在使用AWS - 亚马逊网络服务,并从MAC终端运行命令。
http://ec2-52-xx-x-xx.us-west-2.compute.amazonaws.com
但我遇到了这个错误:
网关超时:无法连接到远程主机
由于此错误,我无法再访问该网站 此实例上应用了安全组 并且ssh的22号端口列在此安全组下
我正在使用AWS - 亚马逊网络服务,并从MAC终端运行命令。
http://ec2-52-xx-x-xx.us-west-2.compute.amazonaws.com
但我遇到了这个错误:
网关超时:无法连接到远程主机
由于此错误,我无法再访问该网站 此实例上应用了安全组 并且ssh的22号端口列在此安全组下
请检查此实例的安全组(Check the security group for this instance),并尝试通过telnet命令连接IP地址 <允许入站端口>。如果telnet命令在这些端口上执行成功,则表示网络连通。
现在考虑SSH连接问题,默认情况下SSH连接使用22端口,因此您需要检查是否有人更改了sshd_config文件和端口号?
端口22用于ssh协议,列在了这个安全组中。
这并不意味着什么。哪些IP地址被允许访问?同时,请检查您的DNS名称是否已更改,如jarmod所建议的。
检查端口22的入站和出站规则,同时尝试使用分配的IP4地址。
To connect using the SSH, ssh should be installed correctly on your machine
just type **"SSH"** if something like this comes up that means your machine has ssh
*usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-E log_file] [-e escape_char]
[-F configfile] [-I pkcs11] [-i identity_file]
[-J [user@]host[:port]] [-L address] [-l login_name] [-m mac_spec]
[-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address]
[-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]]
[user@]hostname [command]*
Mostly **Linux and macOS X** have already installed if not then go to the
[here][1]
For **Windows Server** 2019 and Windows 10 [Openssh in Windows][2]
The first check is there any problem with your ssh is allowed from the security group of that particular instance
like is it allowing to connect from ssh or not
once that is confirmed you have to enter the correct syntax to connect the AWS instance
Using Public DNS that is available under the running instance
**ssh -i /path/my-key-pair.pem my-instance-user-name@my-instance-public-dns-name**
Using ipv6 similarly, ipv4 can be done
**ssh -i /path/my-key-pair.pem my-instance-user-name@my-instance-IPv6-address**
in place of **my-instance-user-name** you can through documentation provided by AWs[1]
[1]: http://www.openssh.com
[2]: https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_overview