Please notice that I don't have any problem with hostname and I can change the hostname by configuring /etc/hostname , and it is easily shown on the terminal.
My problem:
I just setup two servers on CentOS 7, they are not real servers of course, but when I connect to them using ssh, the hostname doesn't replace by server name and it still shows me root@localhost
on the terminal instead of root@server1
OR root@server2
.
The hostname is localhost.localdomain.
/etc/hosts:
27.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.122.1 server1.exampert.com server1
192.168.122.2 server2.exampert.com server2
/etc/hostname:
localhost.localdomain
This question has not been answered. my problem is with hostname which comes after root@ on the terminal when I use ssh command! if I change /etc/hostname or other commands, hostname changes on the terminal as well, but when I use ssh server1
the hostname is still as it was before using the ssh command! I expect it to be root@server1
instead of root@localhost~
What could be the problem?
resolv.conf
file:search localdomain exampert.com
nameserver 192.168.245.2
nameserver 8.8.8.8
nameserver 8.26.56.26
~