1

Вот что я запускаю на сервере (A), чтобы открыть туннель:

ssh -vf -N -T -R 222:localhost:22 me@myserverip -p 2222

Вот что я запускаю на сервере myserver (B), чтобы использовать туннель:

ssh -vp 222 me@localhost

Вот журналы после попытки использования туннеля:

B:

OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to localhost [127.0.0.1] port 1975.
debug1: Connection established.
debug1: identity file /home/aran/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/aran/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/aran/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/aran/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/aran/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/aran/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/aran/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/aran/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
ssh_exchange_identification: Connection closed by remote host

A:

debug1: client_input_channel_open: ctype forwarded-tcpip rchan 2 win 2097152 max 32768
debug1: client_request_forwarded_tcpip: listen localhost port 1975, originator 127.0.0.1 port 51384
debug1: connect_next: host localhost ([127.0.0.1]:22) in progress, fd=4
debug1: channel 0: new [127.0.0.1]
debug1: confirm forwarded-tcpip
debug1: channel 0: connection failed: Connection refused
connect_to localhost port 22: failed.
debug1: channel 0: free: 127.0.0.1, nchannels 1

Может кто-нибудь объяснить мне, что я здесь скучаю?

1 ответ1

1

Вам нужно запустить службу sshd и прослушивать порт 22 на сервере A

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .