LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-17-2015, 09:06 AM   #1
kb2tfa
Member
 
Registered: Oct 2006
Location: New Jersey
Distribution: CentOS
Posts: 175

Rep: Reputation: 18
Question Change SSH login from an ip address to a domain name


Centos 7
Amazon EC2
two ip addresses static and elastic. elastic is public ip which is what I currently ssh into. I want something easier to remember to login with.

I have a registered domain name / vhost on this server. I want to change my ssh login from 'name@public-ip' to 'name@mydomain.com'

Not sure if that makes sense. I'm not sure what to look up to fix this. Not sure if it's a Centos thing, an amazon thing, or both.

If someone could point me in the right direction, that would be great.
 
Old 02-17-2015, 10:27 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,162

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
Are you asking how to set up DNS? Where is your domain name registered?
 
Old 02-17-2015, 10:52 AM   #3
kb2tfa
Member
 
Registered: Oct 2006
Location: New Jersey
Distribution: CentOS
Posts: 175

Original Poster
Rep: Reputation: 18
I don't know what to google or lookup to fix this.

Domain is registered with mediatemple.net, and with nameservers and public ip from amazon

zone records
name TTL Type Data
blank .mydomain.com A ipaddress
*.mydomain.com A
ftp.mydomain.com A
www.mydomain.com 43200 A

Last edited by kb2tfa; 02-17-2015 at 10:57 AM.
 
Old 02-17-2015, 11:38 AM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,162

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
From the command line do

Code:
host mydomain.com
If it returns the correct IP then DNS is ok and you should be able to use it for ssh. If not, find out what's in DNS with:

Code:
dig -t any mydomain.com
 
1 members found this post helpful.
Old 02-17-2015, 11:53 AM   #5
kb2tfa
Member
 
Registered: Oct 2006
Location: New Jersey
Distribution: CentOS
Posts: 175

Original Poster
Rep: Reputation: 18
thank you soo much.

host returned the right ip address. I noticed that host only worked with www in front of the domain, so I tried ssh user@www.domain.com instead of ssh user@domain.com. it works. not sure why it won't work without www, but it's not that big of a deal. My ftp and other programs remember the ip address. I however don't, and I have to search for it when using the terminal. Now I don't have to. thanks again for your help.
 
Old 02-17-2015, 12:57 PM   #6
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,162

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
Technically what it means is that DNS has an A record for www.mydomain.com, but there is only an NS record for mydomain.com. Most web domains have the same A record for both so you don't have to type the "www." to get to the website.
 
Old 02-17-2015, 01:18 PM   #7
Miati
Member
 
Registered: Dec 2014
Distribution: Linux Mint 17.*
Posts: 326

Rep: Reputation: 106Reputation: 106
Generally what I do is something like this:
In ~/.ssh/config

Code:
Host yourhostname
        user miati
        Hostname 345.3.667.3
then..

Code:
ssh yourhostname
will login to 345.3.667.3 with username of miati

Also, tab autocomplete works here as well

Last edited by Miati; 02-17-2015 at 01:20 PM.
 
Old 02-17-2015, 02:01 PM   #8
kb2tfa
Member
 
Registered: Oct 2006
Location: New Jersey
Distribution: CentOS
Posts: 175

Original Poster
Rep: Reputation: 18
I added an A record for mydomain.com without the www to amazon route 53, and it works. I have a zone file with mediatemple because that is where the domain is registered. Amazon requires the same info in their "Route 53" section. It appears that the Amazon requires nameserver info installed on mediatemple, but the "Route 53" zone info seems to override the mediatemple zone file. That confused me just writing it. thanks again
 
  


Reply

Tags
amazon, centos7, hostname change


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Login to ssh using domain name blackRonin Linux - Server 1 01-05-2015 02:49 PM
Foreign domain in SSH last login WhiteClover Linux - Security 1 01-05-2015 01:40 AM
SSH Problem - Can't login using Hostname, can login using ip address jqweezy Linux - Networking 7 01-26-2009 02:21 PM
change nameserver domain on ssh ? maxboost Linux - Networking 1 10-07-2003 11:57 PM
how to change domain name for login fwee Slackware 3 05-27-2003 08:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration