I have a home network with dynamic ip addresses. I would like to obtain ssh-connect from one linux desktop to another one (actually, Ubuntu to CentOS). I can connect with ip address:
loom@ubuntu-desktop:~ $ ssh 192.168.0.110
The problem is dynamic ip. Next day I must know the new ip to connect. I unsuccessfully tried to use hostname rather than ip:
loom@ubuntu-desktop:~ $ ssh centos-desktop ssh: Could not resolve hostname centos-desktop: Name or service not known loom@ubuntu-desktop:~ $ ssh centos-desktop.area ssh: Could not resolve hostname centos-desktop.area: Name or service not known
hosts files for both computers.
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 127.0.0.1 centos-desktop.area centos-desktop ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 localhost 127.0.1.1 ubuntu-desktop.area ubuntu-desktop # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters
How can I organize ssh access in my network?