ssh para servidor predefinido funciona somente depois de eu ssh para ele digitando o ip manualmente

1

No meu arquivo ~/.ssh/config , tenho esta definição

Host limping
    HostName 192.168.1.102
    user <user>

Quando eu digito no terminal

ssh limping

Eu recebo o erro

ssh: connect to host 192.168.1.102 port 22: No route to host

Então, quando eu digito

ssh <user>@192.168.1.102

A conexão funciona e eu posso conectar usando ssh limping também.

O que está faltando?

yotam@Orange:/tmp$ netstat -rn 
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 wlp2s0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 wlp2s0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 wlp2s0

O resultado de netstat -a é o mesmo quando a conexão funciona ou não.

yotam@Orange:/tmp$ ifconfig -a
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:104308 errors:0 dropped:0 overruns:0 frame:0
          TX packets:104308 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:11862688 (11.8 MB)  TX bytes:11862688 (11.8 MB)

wlp2s0    Link encap:Ethernet  HWaddr d8:fc:93:cd:c6:9d  
          inet addr:192.168.1.105  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::9a05:8ee4:e73f:1be6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2526887 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1145245 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2760597592 (2.7 GB)  TX bytes:193162848 (193.1 MB)


yotam@Orange:~/Applications/CondMount$ ssh -v limping
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /home/yotam/.ssh/config
debug1: /home/yotam/.ssh/config line 35: Applying options for limping
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 192.168.1.102 [192.168.1.102] port 22.
debug1: connect to address 192.168.1.102 port 22: No route to host
ssh: connect to host 192.168.1.102 port 22: No route to host
    
por Yotam 12.03.2017 / 17:12

0 respostas