Hello,
I have a physical host centos:
I've got 4 kvm's.
I used hostnamectl set-hostname command to change all 4 kvm's: server1, server1, client1, client2
Verified new change via hostnamectl and hostname commands.
Default /etc/hosts was:
127.0.0.1 localhost.localdomain localhost
::1 localhost localhost.localdomain localhost6 localhost.localdomain6
below the 127.0.0.1 line I added:
192.168.122.xxx (xxx representing number of ifconfig IP to each of the hosts files) client1 client1.example.com client1 ( this was for the client1 host, the others were added accordingly: server1, server2, client2)
I can ssh to all the IP Addresses but I cannot ssh to the hostnames.
Any help is well appreciated.
Lowry
SSH ; can ssh IP, but cannot ssh to hostname
Re: SSH ; can ssh IP, but cannot ssh to hostname
Did you add them to DNS and/or /etc/hosts?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: SSH ; can ssh IP, but cannot ssh to hostname
Hello,
Thank you for the reply.
OK, I messed up and here was the fix.
first, I do not know if this matters but I changed all my /etc/host files and left them default and then added on 3rd line:
IP Address fullhostname friendly name
xxx.xxx.xxx.xxx test.myserver.com test
Then, this was my real mistake:
when I created the hostname using hostnamectl I hade used the test.myserver.com as the hostnames instead of just hostname ( test)
I then rebooted all my kvm's just to be sure of the changes.
I tested both ways on all the kvm's and was able to ssh to all systems.
Thank You for your reply as I appreciate this forum and all the minds working together to learn Cent/RH.
Lowry
Thank you for the reply.
OK, I messed up and here was the fix.
first, I do not know if this matters but I changed all my /etc/host files and left them default and then added on 3rd line:
IP Address fullhostname friendly name
xxx.xxx.xxx.xxx test.myserver.com test
Then, this was my real mistake:
when I created the hostname using hostnamectl I hade used the test.myserver.com as the hostnames instead of just hostname ( test)
I then rebooted all my kvm's just to be sure of the changes.
I tested both ways on all the kvm's and was able to ssh to all systems.
Thank You for your reply as I appreciate this forum and all the minds working together to learn Cent/RH.
Lowry