ssh通过http代理访问服务器

Posted deric

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ssh通过http代理访问服务器相关的知识,希望对你有一定的参考价值。

关键为Corkscrew的使用

下载地址:http://agroman.net/corkscrew/

 

 

以下为转载

 

centos 7,root user

install:Get Corkscrew

download: https://pkgs.org/download/corkscrew

Add ProxyCommand to your SSH config file:

You may or may not have a configuration file for SSH already. It should be located in $HOME/.ssh/config and is a simple text file. Create one if it does not exist and add lines such as these to it:

Host * 
ProxyCommand corkscrew http-proxy.example.com 8080 %h %p

… replacing http-proxy.example.com with the name or address of your http proxy and possibly replacing 8080 with the port on which the proxy listens, which may be 80 or even some other port. The %h and %p will be replaced automatically by SSH with the actual destination host and port.

These two lines tell the SSH client to start another program (corkscrew) to make the actual connection to the SSH server. The Host * line says that this will be done for ALL hosts. If you wish to restrict the hosts for which this will be done, you can put a limited form of regular expression there. See the ssh_config(5) man page for more information. If you don’t have corkscrew in your path or have put it in a non-standard location, you may specify an absolute path to corkscrew in that file as well.

example

ssh [email protected] -p port 
scp -P port -r ./test [email protected]:/home/test/

from:

https://www.mtu.net/~engstrom/ssh-proxy.php

以上是关于ssh通过http代理访问服务器的主要内容,如果未能解决你的问题,请参考以下文章

Nginx之http正向代理

什么是HTTP代理

SSH通过代理连接

HTTP代理是啥意思?

CORBA 代理/代理通过 HTTP 还是通过套接字访问(对于 PHP)?

HTTP代理有啥功能?哪个比较好用?