Estou recebendo o erro abaixo quando tento acesso remoto (via ssh).
ssh: Could not resolve hostname : Name or service not known
Problema:
[daniel@daniel_pc ~]$ ssh [email protected]
ssh: Could not resolve hostname : Name or service not known
Mas isso só acontece quando eu tento acesso remoto com ssh, se eu tentar pingar, por exemplo, eu entendi normalmente, como no exemplo abaixo.
[daniel@daniel_pc ~]$ ping 192.168.0.212
PING 192.168.0.212 (192.168.0.212) 56(84) bytes of data.
64 bytes from 192.168.0.212: icmp_seq=1 ttl=63 time=1.08 ms
64 bytes from 192.168.0.212: icmp_seq=2 ttl=63 time=8.39 ms
64 bytes from 192.168.0.212: icmp_seq=3 ttl=63 time=0.620 ms
64 bytes from 192.168.0.212: icmp_seq=4 ttl=63 time=1.09 ms
^C
--- 192.168.0.212 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3033ms
rtt min/avg/max/mdev = 0.620/2.799/8.396/3.237 ms
O problema começou a acontecer depois que eu adicionei o arquivo "config" em "/home/daniel/.ssh/", e eu alimentei "/ etc / hosts" com as informações do host que eu queria.
Depois que o problema aconteceu, eu apaguei o "config" e deletei as informações dos "hosts", mas o problema continua.
Vale lembrar que quando tento acessar pelo usuário root geralmente acesso.
[daniel@daniel_pc ~]$ su
Senha:
[root@daniel_pc daniel]# ssh 192.168.0.212
Last login: Wed Jul 26 10:44:46 2017 from 192.168.0.99
INFO: Fedora 25
[root@localhost ~]# cat /etc/redhat-release
CentOS release 6.9 (Final)
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-696.1.1.el6.x86_64 #1 SMP Tue Apr 11 17:13:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# cat /proc/version
Linux version 2.6.32-696.1.1.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) ) #1 SMP Tue Apr 11 17:13:24 UTC 2017
[daniel@daniel_pc .ssh]$ ssh -vv [email protected]
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /home/daniel/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
debug1: /etc/ssh/ssh_config.d/05-redhat.conf line 2: include /etc/crypto-policies/back-ends/openssh.config matched no files
debug1: /etc/ssh/ssh_config.d/05-redhat.conf line 8: Applying options for *
debug2: resolving "" port 22
ssh: Could not resolve hostname : Name or service not known