Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
300 views
in Technique[技术] by (71.8m points)

amazon web services - Unable to SSH into AWS Ubuntu 18.04 Server

Hi guys I'm new to cloud and networking so please ask more info If you need... I deployed AWS EC2 instance with Ubuntu 18.04 Server. I assigned two Network Interfaces eth0(primary network interface) and eth1, without public IP address. So in order to access it I assigned Elastic IP to my eth1 interface because, I want to use my eth1 for SSH and eth0 for external Internet connection. But I can't SSH with the Elastic IP assigned to eth1. When I assign Elastic IP to eth0 which is primary interface it works perfectly. If I use eth0 for my SSH, Can I use eth1 to connect to Internet?

question from:https://stackoverflow.com/questions/66064491/unable-to-ssh-into-aws-ubuntu-18-04-server

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I think you are configuring something wrong here. I can confirm the SSH access even when the elastic IP is attached to the non-primary (eth1) n/w interface.

To elaborate my setup, I have setup following things:

  1. An EC2 instance inside the public subnet of a VPC.
  2. Two network interfaces without any public IP address auto-assignment.
  3. Security group which allows SSH access from my local machine.
  4. Elastic IP attached to eth1 (non-primary) interface.

Following command is used to connect to the instance.

ssh -i /path/to/identity/file -vvvv ec2-user@<public-dns-of-elastic-ip>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...