ilmoi
ilmoi

Reputation: 2534

Is it possible to change the hostname of AWS SSH command?

By default AWS EC2 instances are accessible using something like this

ssh -i "key.pem" [email protected]

Is it possible to change that to something along the lines of:

ssh -i "key.pem" [email protected]

Sorry if this is a noob question, I just can't figure out what to even Google. I either get tutorial about SSHing in or tutorial about running websites on an EC2 - neither helpful.

Upvotes: 0

Views: 240

Answers (2)

John Rotenstein
John Rotenstein

Reputation: 269520

If you have your own domain name, then:

  • Assign an Elastic IP address to the instance, which is a static IP address (it won't change if the instance is stopped and started)
  • In your DNS system that controls your Domain Name, create a CNAME record for the subdomain (eg app.mydomain.com) that points to the Elastic IP address

Upvotes: 2

jellycsc
jellycsc

Reputation: 12299

As long as both ec2-00-00-00-00.us-east-2.compute.amazonaws.com and ec2-00-00-00-00.myowndomain.com resolve to the same IP, you will have no accessibility issue with the underlying instance.

Upvotes: 1

Related Questions