HandleSSHConn handles a Tailscale SSH connection from c. This is the entry point for all SSH connections. When this returns, the connection is closed.
(nc net.Conn)
| 164 | // This is the entry point for all SSH connections. |
| 165 | // When this returns, the connection is closed. |
| 166 | func (srv *server) HandleSSHConn(nc net.Conn) error { |
| 167 | metricIncomingConnections.Add(1) |
| 168 | c, err := srv.newConn() |
| 169 | if err != nil { |
| 170 | return err |
| 171 | } |
| 172 | srv.trackActiveConn(c, true) // add |
| 173 | defer srv.trackActiveConn(c, false) // remove |
| 174 | c.HandleConn(nc) |
| 175 | |
| 176 | // Return nil to signal to netstack's interception that it doesn't need to |
| 177 | // log. If ss.HandleConn had problems, it can log itself (ideally on an |
| 178 | // sshSession.logf). |
| 179 | return nil |
| 180 | } |
| 181 | |
| 182 | // Shutdown terminates all active sessions. |
| 183 | func (srv *server) Shutdown() { |