ssh config - do not execute remote command

Solution 1:

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.

Solution 2:

I don't know about mosh, but for the OpenSSH client you can specify a ProxyCommand in the config file. The relevant entry for hostname foobar.baz.edu (my favorite university) and dynamic forwarding of port 9999 would be:

Host FooBar
   HostName foobar.baz.edu
   ProxyCommand ssh -ND 9999 %h