Visit with your cursor
Push the Mac’s pointer past the edge that faces the Linux machine. A coral visitor appears on its screens, labelled with your Mac’s name, and your keys type there. Your own cursor never leaves, so nothing can strand it. ⌃⌥⌘ Home brings it back; Bring Cursor Home in the tray does the same from the host.