Minecraft 서버용 역방향 SSH 터널링

Minecraft 서버용 역방향 SSH 터널링

질문 전체를 읽어주세요. 하단에 매우 중요한 정보가 있습니다!

역방향 SSH 터널을 사용하여 내 VPS의 포트 25565(IP 주소 XXXX)로 가는 모든 트래픽을 내 집 PC의 포트 25565(IP 주소 YYYY)로 전달하려고 합니다. 내가 사용하는 명령은 다음과 같습니다.

ssh -f -v -N -T -R25565:localhost:25565 X.X.X.X (on my home PC)
ssh -v -p 25565 kevin@localhost (on my VPS)

그러나 두 번째 명령은 성공적으로 실행되고 처음에는 약 20초 동안 연결되었다가 종료되고 가 표시됩니다 kex_exchange_identification: Connection closed by remote host. VPS와 집 컴퓨터 모두에 파일이 있습니다 GatewayPorts=yes. sshd_config내 Minecraft 서버에 연결하려고 하면 두 번째 명령 실행 후 약 20초 이내에도 시간 초과가 발생합니다. 첫 번째 명령은 정상적으로 실행됩니다.

내 VPS의 경우 실행하면 sudo tail -n300 /var/log/auth.log | grep "ssh"다음이 표시됩니다.

Apr 17 18:04:56 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2189]: Server listening on 0.0.0.0 port 22.
Apr 17 18:04:56 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2189]: Server listening on :: port 22.
Apr 17 18:04:56 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2189]: Server listening on 0.0.0.0 port 80.
Apr 17 18:04:56 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2189]: Server listening on :: port 80.
Apr 17 18:04:56 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2189]: Server listening on 0.0.0.0 port 443.
Apr 17 18:04:56 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2189]: Server listening on :: port 443.
Apr 17 18:07:00 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2191]: Accepted publickey for kevin from 147.147.74.12 port 34680 ssh2: RSA SHA256:ZK8Guh7WfKkthpCpwtH1vg5izkyWGe24OusFPbCaqz8
Apr 17 18:08:09 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2208]: error: kex_exchange_identification: Connection closed by remote host
Apr 17 18:08:09 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2209]: Invalid user  from 45.227.254.10 port 1356
Apr 17 18:08:09 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2209]: Connection closed by invalid user  45.227.254.10 port 1356 [preauth]
Apr 17 18:11:09 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2217]: Accepted publickey for kevin from 147.147.74.12 port 34812 ssh2: RSA SHA256:ZK8Guh7WfKkthpCpwtH1vg5izkyWGe24OusFPbCaqz8
Apr 17 18:11:29 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2221]: Unable to negotiate with 194.146.224.65 port 34273: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1 [preauth]
Apr 17 18:12:31 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2233]: Accepted publickey for kevin from 147.147.74.12 port 34832 ssh2: RSA SHA256:ZK8Guh7WfKkthpCpwtH1vg5izkyWGe24OusFPbCaqz8
Apr 17 18:13:12 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2237]: Received disconnect from 221.181.185.220 port 58408:11:  [preauth]
Apr 17 18:13:12 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2237]: Disconnected from authenticating user root 221.181.185.220 port 58408 [preauth]
Apr 17 18:13:47 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2242]: Accepted publickey for kevin from 147.147.74.12 port 34854 ssh2: RSA SHA256:ZK8Guh7WfKkthpCpwtH1vg5izkyWGe24OusFPbCaqz8
Apr 17 18:17:23 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2251]: error: kex_exchange_identification: banner line contains invalid characters
Apr 17 18:17:23 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2252]: error: kex_exchange_identification: banner line contains invalid characters
Apr 17 18:17:23 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2252]: error: send_error: write: Connection reset by peer
Apr 17 18:17:25 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2253]: error: kex_exchange_identification: client sent invalid protocol identifier "GET / HTTP/1.1"
Apr 17 18:17:25 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2254]: error: kex_exchange_identification: client sent invalid protocol identifier "GET / HTTP/1.1"
Apr 17 18:17:26 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2255]: Connection reset by authenticating user root 66.228.33.98 port 50894 [preauth]
Apr 17 18:17:26 ubuntu-s-1vcpu-1gb-lon1-01 sshd[2257]: Connection reset by authenticating user root 69.164.222.108 port 55782 [preauth]
Apr 17 18:20:26 ubuntu-s-1vcpu-1gb-lon1-01 sudo:    kevin : TTY=pts/0 ; PWD=/etc/ssh ; USER=root ; COMMAND=/usr/bin/tail -n300 /var/log/auth.log
Apr 17 18:22:28 ubuntu-s-1vcpu-1gb-lon1-01 sudo:    kevin : TTY=pts/0 ; PWD=/etc/ssh ; USER=root ; COMMAND=/usr/sbin/ufw allow 25565
Apr 17 18:24:02 ubuntu-s-1vcpu-1gb-lon1-01 sudo:    kevin : TTY=pts/0 ; PWD=/etc/ssh ; USER=root ; COMMAND=/usr/bin/tail -n300 /var/log/auth.log

내 질문은 다음과 같습니다

  1. 내가 뭘 잘못했나요? (아무거나)
  2. 내 실수를 어떻게 바로잡을 수 있나요?

궁극적으로 가장 큰 질문은 XXXX:25565에 대한 모든 Minecraft 트래픽이 실제 서버가 실행되는 YYYY:25565로 전달되도록 역방향 SSH 터널을 작동시키는 방법입니다.

XXXX가 OpenVPN을 실행하고 있으며 클라이언트 YYYY에 대한 OpenVPN 서버 역할을 한다는 점은 주목할 가치가 있습니다.

관련 정보