ssh: don't use -l option for shells on FreeBSD

Shells on FreeBSD don't support the -l option. This means that when
handling SSH in-process, we can't give the user a login shell, but this
change at least allows connecting at all.

Updates #13338

Signed-off-by: Percy Wegmann <percy@tailscale.com>
This commit is contained in:
Percy Wegmann 2025-02-03 16:22:05 -06:00 committed by Percy Wegmann
parent e6e00012b2
commit e4bee94857

View File

@ -1089,6 +1089,10 @@ func (ia *incubatorArgs) loginArgs(loginCmdPath string) []string {
func shellArgs(isShell bool, cmd string) []string {
if isShell {
if runtime.GOOS == "freebsd" {
// freebsd's shells don't support the "-l" option, so we can't run as a login shell
return []string{}
}
return []string{"-l"}
} else {
return []string{"-c", cmd}