Назад | Перейти на главную страницу

ssh не работает через http-прокси с помощью штопора

Я пытаюсь подключиться по SSH к удаленному серверу через HTTP-прокси, используя штопор и следующую строфу в ~ / .ssh / config:

Host target
  ProxyCommand corkscrew proxy 80 remote.host.ip 443 ~/.ssh/proxyauth

где; «proxy 80» - это DNS-имя и порт HTTP-прокси, мой ssh-сервер настроен на прослушивание порта 443 remote.host.ip, а файл proxyauth содержит «user: password», необходимый для доступа к HTTP-прокси.

На клиенте я получаю следующее;

$ ssh target
ssh_exchange_identification: Connection closed by remote host

а на сервере в /var/log/auth.log я получаю;

Mar 12 13:16:32 hostname sshd[16029]: Did not receive identification string from x.x.x.x

Похоже, что SSH-клиент (OpenSSH) неправильно инициирует протокол или что прокси каким-то образом искажает его, а затем сервер закрывает соединение.

То, что я пробовал и устранил:

  1. Запуск corkscrew непосредственно на клиентском компьютере с теми же параметрами, что и в ~ / .ssh / config ProxyCommand. Это работает, и я вижу серверный протокол баннерной рекламы SSH и информацию о версии. Таким образом, базовое подключение через HTTP-прокси работает, и SSHD определенно доступен (что также подтверждается записями журнала на сервере).

  2. Проверена пара ключей клиента на том же сервере, но с хоста, не требующего прокси. Это работает нормально, значит, пара ключей в порядке.

  3. Увеличено ведение журнала на обоих концах SSH, показаны результаты;

клиент ...

$ ssh -vvv target
OpenSSH_6.2p2, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /home/davisond/.ssh/config
debug1: /home/davisond/.ssh/config line 3: Applying options for home
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 50: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Executing proxy command: exec corkscrew proxy 80 remote.host.ip 443 ~/.ssh/proxyauth
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/davisond/.ssh/id_rsa" as a RSA1 public key
debug1: permanently_drop_suid: 1000
debug1: identity file /home/davisond/.ssh/id_rsa type 1
debug1: identity file /home/davisond/.ssh/id_rsa-cert type -1
debug1: identity file /home/davisond/.ssh/id_dsa type -1
debug1: identity file /home/davisond/.ssh/id_dsa-cert type -1
debug1: identity file /home/davisond/.ssh/id_ecdsa type -1
debug1: identity file /home/davisond/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
ssh_exchange_identification: Connection closed by remote host

и на сервере;

Mar 12 13:23:49 hepburn sshd[20786]: debug1: Forked child 20997.
Mar 12 13:23:49 hepburn sshd[20997]: Set /proc/self/oom_score_adj to 0
Mar 12 13:23:49 hepburn sshd[20997]: debug1: rexec start in 5 out 5 newsock 5 pipe 7 sock 8
Mar 12 13:23:49 hepburn sshd[20997]: debug1: inetd sockets after dupping: 3, 3
Mar 12 13:23:49 hepburn sshd[20997]: Connection from x.x.x.x port 22104
Mar 12 13:23:49 hepburn sshd[20997]: Did not receive identification string from x.x.x.x

Кто-нибудь предлагает указатели, куда идти, чтобы эта работа работала?