How Does Openssh Implement Local Port Forward?
I Started a Sshd(Using Go-Ssh) to Listen Ssh-Client, and Run Ssh -L 2345:127.0.0.1:5244 127.0.0.1 -P 2022 -N. I Didn't Receive Any Message from Client (Include...
I started a sshd(using go-ssh) to listen ssh-client,
and run ssh -L 2345:127.0.0.1:5244 127.0.0.1 -p 2022 -N.
I didn't receive any message from client (include "direct-tcpip" ), but I can access web through 127.0.0.1:2345.
How does OpenSSH implement local port forward?
I hope than I can receive "direct-tcpip" from client.
sshConn, ch, globalRequestCh, err := ssh.NewServerConn(conn, config)
if err != nil {
log.Println("Handshake err", err)
return
}
log.Println("sshd serving", "ssh client", sshConn.RemoteAddr())
go func() {
// handle newChan
for newChannel := range ch {
log.Println("new channel", "type", newChannel.ChannelType())
switch newChannel.ChannelType() {
case "session":
case "direct-tcpip":
default:
}
}
}()
// handle globalRequest
for globalRequest := range globalRequestCh {
log.Println("global request", "type", globalRequest.Type)
switch globalRequest.Type {
case "tcpip-forward":
case "cancel-tcpip-forward":
default:
}
}