기본 콘텐츠로 건너뛰기

글

라벨이 ssh tunneling인 게시물 표시

ssh remote forwarding auto reconnect / ssh remote tunneling auto reconnect

ssh remote forwarding auto reconnect Hardware Box  ============================= serverA  : with public ip serverB  : inner firewall prepare : ssh , autossh (ServerB) 1. ServerB # cd ~  go home directory # ssh - keygen -t rsa    no passphrase (not that secure, but easy to setup)  you should now have the key pair in the . ssh directory (id_rsa & id_rsa.pub) # cp ~/. ssh /id_rsa.pub ~/. ssh /authorized_key_serverB  make a copy of your public key with the name 'authorized_key' # scp ~/. ssh /authorized_key_serverB <remote user>@<ServerA's ipaddress >:'/<user's home dir >/. ssh /'  copy authorized_key to ServerA 2. ServerA #cat ~/. ssh /authorized_key_serverB >> ~/. ssh /authorized_keys 3. ServerB # autossh -i ~/. ssh /id_rsa -L 1234: localhost :6667 <remote user>@<ServerA's ipaddress > << ssh forwarding # autossh...