Ssh config – do not execute remote command

ssh

I would like to setup one of the SSH connections in my ssh_config file to use the -N ssh flag. I can't find any matching config keyword for this parameter. I'm using the connection for port forwarding only and I would like it to use -N every time I execute ssh host. I'm using mosh for the interactive shell.

-N      Do not execute a remote command.  This is useful for just forwarding ports (protocol version 2 only).

Best Answer

I'm fairly sure you can't do that and like you I can't find a way of doing it in the manner that you want. If typing ssh -N host doesn't appeal then you could always try creating an alias if mosh supports it.