Open woodlyer opened 1 year ago
Hi, I'm trying to connect to Server B through Server A with ssh, basically I can connect to Server B fine with: gost -L=:9050 -F forward+ssh://user@serverb:port but now I want to add Server A in the middle and currently no luck!
Please help! Thanks in advance
build a tunnel from A to B for ssh port 22 like this. kcp can be replaced with tls.
# server B
./gost -L kcp://:9000/:22
# server A
./gost -L tcp://:9050 -F forward+kcp://serverB_ip:9000
# ssh client to connect serverB with ssh.
ssh user@serverA_ip -p 9050
Thanks I think I didn't explain exactly what I need, I need a proxy (socks) through ssh protocol. I'm doing like this now:
# this will listen on local port 2222 and redirect connections to server B (through server A)
ssh -L 2222:<serverB_ip>:<serverB_port> <serverA_user>@<serverA_ip>:<serverA_port>
# forwards socks requests to server B (through server A)
gost-linux-armv8-2.11.4 -L=:<local_socks_listen_port> -F forward+ssh://<serverB_user>@localhost:2222
but still, this is a two step process (run ssh then run gost). I wonder if it can be run in just one gost command (chained).
And also, I've tried chaining -F (forward+)ssh://
I' m sorry, gost is a very powerful tool.
I just make some tunnel example and proxy example.
I'm not very familiar with chains.
build a tunnel from A to B for ssh port 22 like this. kcp can be replaced with tls.
# server B ./gost -L kcp://:9000/:22 # server A ./gost -L tcp://:9050 -F forward+kcp://serverB_ip:9000 # ssh client to connect serverB with ssh. ssh user@serverA_ip -p 9050
When I type code like this,the ssh -vvv says
debug1: Local version string SSH-2.0-OpenSSH_7.4
ssh_exchange_identification: Connection closed by remote host
the gost log seems the server A didn't send kcp request to server B, I'm confused for a long time
This cmd is ok. Please check udp is not blocked. for example: use kcp on tcp or tls.
./gost -L kcp://:9000/:22?tcp=true
./gost -L tcp://:9050 -F forward+kcp://serverB_ip:9000?tcp=true
This cmd is ok. Please check udp is not blocked. for example: use kcp on tcp or tls.
./gost -L kcp://:9000/:22?tcp=true ./gost -L tcp://:9050 -F forward+kcp://serverB_ip:9000?tcp=true
Thx
https://github.com/woodlyer/gostExample for more infomation.
Wish it is helpful for someone.