osx - SSH to a remote host that is not reachable directly -


there host not accessible local network. there host b can access via ssh , visible b. setup ssh tunnel , try access via b

ssh -n -d 7070 username@host_b 

my ~/.ssh/config looks

host host_a     proxycommand socat - proxy:127.0.0.1:7070:%h:%p,proxyport=7070 

when run following command

ssh -v username@host_a 

i got following error.

debug1: identity file /users/leo/.ssh/id_rsa type -1 debug1: permanently_drop_suid: 501 debug1: identity file /users/leo/.ssh/id_rsa-cert type -1 debug1: identity file /users/leo/.ssh/id_dsa type 2 debug1: identity file /users/leo/.ssh/id_dsa-cert type -1 2013/05/21 22:19:13 socat[4537] e proxy_connect: connection closed proxy ssh_exchange_identification: connection closed remote host 

there no /etc/hosts.allow or /etc/hosts.deny on machine. using mac os.

you asking socat connect http proxy, ssh tunnel set socks proxy. tell socat connect socks proxy:

host host_a     proxycommand socat - socks4:127.0.0.1:7070:%h:%p,proxyport=7070 

(other socks options may available --- check man socat particular socat have installed.)

but don't want have setup ssh tunnel in advance. usual way use netcat on host_b:

host host_a     proxycommand /usr/bin/ssh username@host_b /bin/nc %h %p 

(changes pathnames ssh , netcat necessary.)

demure's ssh -t host_b ssh host_a method works, cannot configured in ~/.ssh/config.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -