diff --git a/lib/service/service.go b/lib/service/service.go
index <HASH>..<HASH> 100644
--- a/lib/service/service.go
+++ b/lib/service/service.go
@@ -1588,12 +1588,14 @@ func (process *TeleportProcess) initSSH() error {
 				warnOnErr(s.Shutdown(payloadContext(payload)))
 			}
 		}
-		if conn.UseTunnel() {
+		if conn != nil && conn.UseTunnel() {
 			agentPool.Stop()
 		}
 
-		// Close BPF service.
-		warnOnErr(ebpf.Close())
+		if ebpf != nil {
+			// Close BPF service.
+			warnOnErr(ebpf.Close())
+		}
 
 		log.Infof("Exited.")
 	})
Prevent nil pointer panic on node shutdown

If node hasn't fully initialized before getting stopped (such as when
join token isn't valid), most pointer vars in `initSSH` will be nil.
Handle that cleanly.