Ping-Hostname funktioniert, aber SSH nicht für lokalen Rechner

Ping-Hostname funktioniert, aber SSH nicht für lokalen Rechner

Das ist interessant.

Wie lauten unser Hostname und unsere IP?

echo $hostname $(ipaddr)

TCA0080ALKVTAGB xx.xx.242.47

pingWerke:

$ping $(hostname)

PING TCA0080ALKVTAGB (xx.xxx.242.47): 56 data bytes
64 bytes from xx.xxx.242.47: icmp_seq=0 ttl=64 time=0.049 ms
64 bytes from xx.xxx.242.47: icmp_seq=1 ttl=64 time=0.102 ms

sshtutnicht: geht anscheinend in der DNS-Welt verloren (für denselben Host):

 $ssh $(hostname)

ssh: Could not resolve hostname tca0080alkvtagb: nodename nor servname provided, or not known

Hinweis: Wir haben Folgendes bereits deaktiviert ipv6:

networksetup -setv6off Wi-Fi

Dies ist auf El Capitan.

Für Neugierige ipaddr:

 $type ipaddr
ipaddr is a function
ipaddr () 
{
    ifconfig -a | grep -A 6 en0 | grep "inet " | awk '{print $2}'
}

Ach ja! Nicht zu vergessen: sshmit der IP-Adresse funktioniert es:

ssh xx.xx.242.47
Last login: Mon Jan 16 12:24:08 2017 from xx.xx.242.47

Aktualisieren

Telnetfunktioniert gut;

telnet $(hostname) 22

Hier ist die Ausgabe von `ssh -vvv $(Hostname)

 $ssh -vvv $(hostname)

OpenSSH_6.9p1, LibreSSL 2.1.8
debug1: Reading configuration data /Users/boesc**/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: /etc/ssh/ssh_config line 56: Applying options for *
ssh: Could not resolve hostname tca0080alkvtagb: nodename nor servname provided, or not known

Antwort1

TL;DR: ein macosIsmus..

ssh $(hostname).local 

funktioniert. Dank an die folgenden Fragen und Antworten für „Hilfestellung“: https://stackoverflow.com/a/33506923/1056563

Zusätzlich sollte noch das von : .localhinzugefügt werden, wie hier erwähnt:searchDNShttps://apple.stackexchange.com/a/197884/55242

verwandte Informationen