I have a home server behind a NAT. At work I'm also behind a NAT. So to connect from work to my home server I would have to port forward the SSH port in my router at home to the WAN interface.
Would it also be possible to have a permanent ssh tunnel from my home server to a webserver I own. Then when I connect from work I connect to the webserver and let it tunnel to the SSH server on my home server.
And if possible, what would be the security implications?
On your home server connect using ssh -R 2222:127.0.0.1:22 [email protected] -N
This will open a ssh session to your webserver.
The -R 2222:127.0.0.1:22
maps port 2222
on the remote server to be redirected to the IP address:port specified in your case 127.0.0.1:22
Use -N
if you don't want an interactive session.
On the client connect to your webserver using ssh -p 2222 [email protected]
you must specify the port since it's not the default.
You also have open the port in your firewall configuration.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다