![]() Note: my answer assume that you have already created ssh keys and that your sshd_config file is configured well. Now after the tunnel seems to work fine we can automate the process by creating an autossh service (here is the one i am using):ĮxecStart=/usr/bin/autossh -M portZ -i /root/.ssh/id_ed25519 -o "ExitOnForwardFaliure=yes" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -N -R portX:127.0.0.1:22 if you want to copy something into your computer with scp from server A just run the command on your local pc terminal:.On the remote side the accesspoint does a. connect to your A server from your local pc with ssh on your server A shell - port forward the ssh connection from server A to server B with ssh -R :localhost:22 on your server B shell - port forward the serverA ssh tunnel with ssh -R :localhost: now open another terminal on your local pc (without closing the existing terminal) and try to use the redirected tunnel with ssh -p this should connect you to server A through servers C and B in the specific order. The idea is that SSH -D on the local side sets up a SOCKS proxy server which redirects all traffic to the SSH server.Now you have to redirect the ports you want with autossh - but first lets check that manually:.do the same with server C - save your server B public_key on your server C /home/user/.ssh/authorized_keys file.make the first connection manually with ssh and see the connection is working fine.save your server A public_key on your server B /home/user/.ssh/authorized_keys file. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |