MCPcopy Index your code
hub / github.com/tailscale/tailscale / HandleSSHConn

Method HandleSSHConn

ssh/tailssh/tailssh.go:166–180  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

164// This is the entry point for all SSH connections.
165// When this returns, the connection is closed.
166func (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.
183func (srv *server) Shutdown() {

Callers 6

TestMultipleRecordersFunction · 0.95
TestSSHAuthFlowFunction · 0.95
testServerFunction · 0.95
testServerWithOptsFunction · 0.95

Calls 4

newConnMethod · 0.95
trackActiveConnMethod · 0.95
AddMethod · 0.65
HandleConnMethod · 0.65

Tested by 6

TestMultipleRecordersFunction · 0.76
TestSSHAuthFlowFunction · 0.76
testServerFunction · 0.76
testServerWithOptsFunction · 0.76