简体   繁体   中英

Can't connect to Amazon EC2 instance with PuTTY

I have been able to connect to Amazon Web Services EC2 with the free tier and run R programs with it. Now I am trying to use an instance with a Spot Request. The instance is created and running and both Status Checks are okay. However, PuTTY will not connect. PuTTY will still connect to the free instance using the same steps and the same key pair .

Can anyone suggest what I am doing incorrectly? Here are the details of the two instances if this information might be helpful. I am hiding portions of the Instance IDs , the IPs , the Owner ID and the Reservations and have provided a fake key pair name.

Here are Description details of the Spot instance I cannot connect to with PuTTY :

Instance ID: i-XXXXXa30498b1b9ca
Public DNS (IPv4): ec2-XX-XXX-XXX-XXX.us-east-2.compute.amazonaws.com
Instance state: running
IPv4 Public IP: XX.XXX.XXX.XXX
Instance type: r4.xlarge
IPv6 IPs: -
Elastic IPs:
Private DNS: ip-XXX-XX-XX-XX.us-east-2.compute.internal
Availability zone: us-east-2b
Private IPs: XXX.XX.XX.XX
Security groups: default. view inbound rules. view outbound rules
Secondary private IPs
Scheduled events: No scheduled events
VPC ID: vpc-ce0c17a6
AMI ID: ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20191002 (ami-0d5d9d301c853a04a)
Subnet ID: subnet-b3f881c9
Platform: -
Network interfaces: eth0
IAM role: -
Source/dest. Check: True
Key pair name: mykeyb
T2/T3 Unlimited: -
Owner: XXXXXXXXXXXX
EBS-optimized: False
Launch time: November 26, 2019 at 5:43:37 PM UTC-5 (1 hour)
Root device type: ebs
Termination protection: False
Root device: /dev/sda1
Lifecycle: spot
Block devices: /dev/sda1
Monitoring: basic
Elastic Graphics ID: -
Alarm status: None
Elastic Inference accelerator ID: -
Kernel ID: -
Capacity Reservation: -
RAM disk ID: -
Capacity Reservation Settings: Open
Placement group: -
Partition number: -
Virtualization: hvm
Reservation: r-XaecaXXbfXacXXXXX
AMI launch index: 0
Tenancy: default
Host ID: -
Affinity: -
State transition reason: -
State transition reason message: -
Stop - Hibernation behavior: Disabled
Number of vCPUs: 4

Here are the Description details for the Free Instance I can connect to with PuTTY :

Instance ID: i-ZZdZZZZZ41cZZZZZZ
Public DNS (IPv4): ec2-X-XXX-XXX-XX.us-east-2.compute.amazonaws.com
Instance state: running
IPv4 Public IP: X.XXX.XXX.XX
Instance type: t2.micro
IPv6 IPs: -
Elastic IPs:
Private DNS: ip-XXX-XX-XX-XXX.us-east-2.compute.internal
Availability zone: us-east-2b
Private IPs: XXX.XX.XX.XXX
Security groups: launch-wizard-5. view inbound rules. view outbound rules
Secondary private IPs:
Scheduled events: No scheduled events
VPC ID: vpc-ce0c17a6
AMI ID: ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20191002 (ami-0d5d9d301c853a04a)
Subnet ID: subnet-b3f881c9
Platform: -
Network interfaces: eth0
IAM role: -
Source/dest. check: True
Key pair name: mykeyb
T2/T3 Unlimited: Disabled
Owner: XXXXXXXXXXXX
EBS-optimized: False
Launch time: November 22, 2019 at 12:16:56 AM UTC-5 (less than one hour)
Root device type: ebs
Termination protection: False
Root device: /dev/sda1
Lifecycle: normal
Block devices: /dev/sda1
Monitoring: basic
Elastic Graphics ID: -
Alarm status: None
Elastic Inference accelerator ID: -
Kernel ID: -
Capacity Reservation: -
RAM disk ID: -
Capacity Reservation Settings: Open
Placement group: -
Partition number: -
Virtualization: hvm
Reservation: r-XXaXXXdfXXXXfXXXX
AMI launch index: 0
Tenancy: default
Host ID: -
Affinity: -
State transition reason: -
State transition reason message: -
Stop - Hibernation behavior: Disabled
Number of vCPUs: 1

The security groups on your two EC2 instances are different. Security Groups are sets of firewall rules. You need to allow inbound port 22 (SSH) to the spot instance. One simple way you can do that, given that both instances are in the same VPC, is to add the launch-wizard-5 security group to the spot instance. Or create a new security group with the equivalent set of ingress rules, and add that to the spot instance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM