
Este es uno interesante.
¿Cuál es nuestro nombre de host e IP?
echo $hostname $(ipaddr)
TCA0080ALKVTAGB xx.xx.242.47
ping
obras:
$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
ssh
haceno: aparentemente se pierde en el mundo dns (para el mismo host):
$ssh $(hostname)
ssh: Could not resolve hostname tca0080alkvtagb: nodename nor servname provided, or not known
Nota: ya hemos desactivado ipv6
:
networksetup -setv6off Wi-Fi
Esto está encendido El Capitan
.
Para los curiosos sobre ipaddr
:
$type ipaddr
ipaddr is a function
ipaddr ()
{
ifconfig -a | grep -A 6 en0 | grep "inet " | awk '{print $2}'
}
¡Oh! No olvidemos mencionar: ssh
con la dirección IP funciona:
ssh xx.xx.242.47
Last login: Mon Jan 16 12:24:08 2017 from xx.xx.242.47
Actualizar
Telnet
funciona bien;
telnet $(hostname) 22
Aquí está la salida `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
Respuesta1
TL;DR: un macos
ismo..
ssh $(hostname).local
obras. Crédito a las siguientes preguntas y respuestas por "dar una mano": https://stackoverflow.com/a/33506923/1056563
Además, se .local
debe agregar search
desde DNS
: como se menciona aquí:https://apple.stackexchange.com/a/197884/55242