diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 3921ecc23..ea6de728d 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -1394,6 +1394,7 @@ Host toto7toto # KnownHostOf: toto[7-9]toto Host toutou + RemoteCommand date >> /tmp/logs # Comment: [First line Second line Third line] # ResolveCommand: dig -t %h diff --git a/pkg/config/host.go b/pkg/config/host.go index 31036670d..169921800 100644 --- a/pkg/config/host.go +++ b/pkg/config/host.go @@ -1301,6 +1301,9 @@ func (h *Host) WriteSSHConfigTo(w io.Writer) error { if h.LocalCommand != "" { _, _ = fmt.Fprintf(w, " LocalCommand %s\n", h.LocalCommand) } + if h.RemoteCommand != "" { + _, _ = fmt.Fprintf(w, " RemoteCommand %s\n", h.RemoteCommand) + } for _, entry := range h.LocalForward { _, _ = fmt.Fprintf(w, " LocalForward %s\n", entry) }