putty上SSH的端口转发设置
2017-09-15 10:44
1126 查看
Portforwarding with SSH (Putty)Martin Zahn, 10.10.2008 |
---|
Overview Often you do not have direct access to a desired server, because a firewall blocks the port or you are on another network than the server. But eventually you may have access to a proxy server, from which you can access the desired server. For example you would like to access an Oracle database on 192.168.151.2 on port 1521 with you local SQL tools and you don't want to do it from the proxy server. With SSH port forwarding you can establish a logical connection through the proxy an you will then be able to access the Oracle database through it. You can use the very common SSH client PUTTY to establish this logical connection Port Forwarding using SSH In order to use port forwarding to connect from your local machine to a port on a remote server, you need to: Choose a port number on your local machine (e.g. 5500) where PuTTY should listen for incoming connections. Now, before you start your SSH connection, go to the PuTTY Tunnels panel. Make sure the «Local» radio button is set. Enter the local port (e.g. 5500) number into the «Source port» box. Enter the destination host name and port number into the «Destination» box, separated by a colon (e.g. 192.168.151.2:1521). Now click the [Add] button. The details of your port forwarding should appear in the list box. Now start your session and log in to the proxy host. To check that PuTTY has set up the port forwarding correctly, you can look at the PuTTY Event Log. Now if you connect to the source port number on your local PC, you should find that it answers you exactly as if it were the service running on the destination machine. You can also forward ports in the other direction: arrange for a particular port number on the server machine to be forwarded back to your PC as a connection to a service on your PC or near it. To do this, just select the «Remote» radio button instead of the «Local» one. The «Source port» box will now specify a port number on the server. Enter Source and Destination, then click Add Button After clicking the Add Button X11 Forwarding If you need to start a graphical application from the database server (on 192.168.151.2) and the output should be displayed on your local PC, then you must activate X11 forwarding in PUTTY. Now log in to the SSH proxy server as normal. To check that X forwarding has been successfully negotiated during connection startup, you can check the PuTTY Event Log. From the proxy server you must now enable X11 forwarding to the DB server, this can be established with the -X option of ssh. proxy> ssh -X oracle@192.168.151.2 Now you can start for example Oracle's runInstaller and the output is displayed on your local PC - do not forget to start the cygwin X11 server on the PC. |
相关文章推荐
- ssh putty 端口转发实例
- 利用Putty通过ssh端口转发实现FireFox和MSN加密代理访问
- 基于SSH端口转发实现telnet的安全传输
- SSH端口转发详解及实例
- Linux下的SSH端口转发
- 实战 SSH 端口转发
- ssh port forwarding(ssh端口转发)
- 使用SSH进行端口转发
- 80端口复用:利用haproxy把http流量和ssh流量分别转发到web服务器和ssh服务器
- VM安装CentOS7 Minimal静态IP配置,并设置VM端口转发和xshell连接(一)
- 实战ssh端口转发
- 《Python 黑帽子》学习笔记 - SSH 端口转发 - Day 12
- 于ssh端口转发的深入实例[转
- 利用SSH端口转发功能实现X转发
- ssh端口转发原理
- SSH隧道与端口转发及内网穿透
- 4-3·SSH免密、秘钥验证、端口转发
- SSH 端口转发
- SSH端口转发的理解(精华)