{"record":{"id":"79b11d887bad50cb","repo":"kovidgoyal/kitty","slug":"cannot-use-forward-remote-control-yes-without-shar","errorCode":null,"errorMessage":"Cannot use forward_remote_control=yes without share_connections=yes as it relies on SSH Controlmasters","messagePattern":"Cannot use forward_remote_control=yes without share_connections=yes as it relies on SSH Controlmasters","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/ssh/main.go","lineNumber":721,"sourceCode":"\t}\n\trun_control_master := func() error {\n\t\tcmcmd := slices.Clone(cmd[:insertion_point])\n\t\tcmcmd = append(cmcmd, control_master_args...)\n\t\tcmcmd = append(cmcmd, \"-N\", \"-f\")\n\t\tcmcmd = append(cmcmd, \"--\", hostname)\n\t\tc := exec.Command(cmcmd[0], cmcmd[1:]...)\n\t\tc.Stdin, c.Stdout, c.Stderr = os.Stdin, os.Stdout, os.Stderr\n\t\terr := c.Run()\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"Failed to start SSH ControlMaster with cmdline: %s and error: %w\", strings.Join(cmcmd, \" \"), err)\n\t\t}\n\t\tmaster_checked = false\n\t\tmaster_is_alive = false\n\t\treturn err\n\t}\n\tif host_opts.Forward_remote_control && os.Getenv(\"KITTY_LISTEN_ON\") != \"\" {\n\t\tif !host_opts.Share_connections {\n\t\t\treturn 1, fmt.Errorf(\"Cannot use forward_remote_control=yes without share_connections=yes as it relies on SSH Controlmasters\")\n\t\t}\n\t\tif !master_is_functional() {\n\t\t\tif err = run_control_master(); err != nil {\n\t\t\t\treturn 1, err\n\t\t\t}\n\t\t\tif !master_is_functional() {\n\t\t\t\treturn 1, fmt.Errorf(\"SSH ControlMaster not functional after being started explicitly\")\n\t\t\t}\n\t\t}\n\t\tprotocol, listen_on, found := strings.Cut(os.Getenv(\"KITTY_LISTEN_ON\"), \":\")\n\t\tif !found {\n\t\t\treturn 1, fmt.Errorf(\"Invalid KITTY_LISTEN_ON: %#v\", os.Getenv(\"KITTY_LISTEN_ON\"))\n\t\t}\n\t\tif protocol == \"unix\" && strings.HasPrefix(listen_on, \"@\") {\n\t\t\treturn 1, fmt.Errorf(\"Cannot forward kitty remote control socket when an abstract UNIX socket (%s) is used, due to limitations in OpenSSH. Use either a path based one or a TCP socket\", listen_on)\n\t\t}\n\t\tcmcmd := slices.Clone(cmd[:insertion_point])\n\t\tcmcmd = append(cmcmd, control_master_args...)","sourceCodeStart":703,"sourceCodeEnd":739,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/ssh/main.go#L703-L739","documentation":"Thrown by the kitty SSH kitten when forward_remote_control=yes is set in the SSH kitten config but share_connections is not enabled. Forwarding kitty's remote control socket to the remote host is implemented via SSH ControlMaster multiplexing, so it cannot work without it.","triggerScenarios":"Running kitty's ssh kitten with forward_remote_control=yes while share_connections is unset/no (the default) in kitty.conf or the ssh kitten config file, while KITTY_LISTEN_ON is set.","commonSituations":"Enabling remote control forwarding to use kitty remote control commands over SSH without also turning on connection sharing; overriding share_connections=no in a per-host config block.","solutions":["Set share_connections=yes in the SSH kitten config (kitty.conf ssh config or ~/.config/kitty/ssh.conf)","Alternatively remove forward_remote_control=yes if you don't need remote control on the remote host"],"exampleFix":"# before\nforward_remote_control yes\nshare_connections no\n\n# after\nforward_remote_control yes\nshare_connections yes","handlingStrategy":"validation","validationCode":"# in ssh.conf / kitty.conf, verify before running:\ngrep -E 'forward_remote_control\\s+yes' ~/.config/kitty/ssh.conf && \\\n  grep -E 'share_connections\\s+yes' ~/.config/kitty/ssh.conf || echo 'must enable share_connections'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set share_connections=yes whenever forward_remote_control=yes","Keep ssh kitten options together in one config block so overrides don't disable sharing"],"tags":["kitty","ssh","config","remote-control"],"backgroundTag":"invalid-configuration-combination","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}