How to Use SSH Tunneling to Access Restricted Servers and Browse Securely

搬运自 https://www.howtogeek.com/168145/how-to-use-ssh-tunneling/

For example, let’s say the database server at your office is located at 192.168.1.111 on the office network. You have access to the office’s SSH server at ssh.youroffice.com , and your user account on the SSH server is bob . In that case, your command would look like this:

ssh -L 8888:192.168.1.111:1234 bob@ssh.youroffice.com

After running that command, you’d be able to access the database server at port 8888 at localhost. So, if the database server offered web access, you could plug http://localhost:8888 into your web browser to access it. If you had a command line tool that needs the network address of a database, you’d point it at localhost:8888. All traffic sent to port 8888 on your PC will be tunneled to 192.168.1.111:1234 on your office network.

posted on 2019-03-29 10:22  likeatree  阅读(194)  评论(0编辑  收藏  举报

导航