feature request for remote command to be allowed to be specified in the ssh_config. What I'd like this for is to set up entries like: host client-tx-web02-console user clientname hostname lish-dallas.linode.com RequestTTY force RemoteCommand tx-web02 This would be for Linode's lish console but other uses are convenient: ( https://blog.linode.com/2013/04/30/lish-ssh-gateway/ ) This perhaps would solve part the requirement in #1368 too.
Created attachment 2348 [details] simple patch First simple patch of the implementation. I probably should implement a bunch of percent_expand expressions on it. Thoughts?
Created attachment 2349 [details] RemoteCommand / PermitRemoteCommand + tests and doco Since PermitLocalCommand is required for LocalCommand I added PermitRemoteCommand in the same way. RemoteCommand can take a number of expansions. The command as an argument to ssh will always disable RemoteCommand. Patch includes test cases and manual changes.
Created attachment 2350 [details] RemoteCommand / PermitRemoteCommand + tests and doco (with tabs) Fixes whitespace
*** Bug 2558 has been marked as a duplicate of this bug. ***
Created attachment 2839 [details] RemoteCommand for openssh-7.2_p2 Thank you for this patch, Daniel! I've been looking for this for quite a while. Juggling aliases is very annoying. (see bug 2558) I've ported the over to v7.2_p2. I left out PermitRemoteCommand however, as it is pretty pointless when anyone can just specify it on the command line anyway.
Thanks, good call on PermitRemoteCommand
Would it be possible to have this patch updated to handle ssh's -N? 'RemoteCommand none' perhaps? RemoteCommand none # Do not execute a remote command.
new in OpenSSH-7.6 http://www.openssh.com/txt/release-7.6 thank you Alexander Bluhm sorry to see you missing credits in Release notes (along with Mike Frysinger and Ingo Schwarze) patches: https://github.com/openssh/openssh-portable/commit/1112b534a6a7a07190e497e6bf86b0d5c5fb02dc https://github.com/bluhm/ssh/commit/e49bd120b209e48186243c5375b46b95363ac101#diff-b7f1e8dab0f3981a0a9c8c50af26d12b
It got merged, but in a modified version. Now specifying a command line to ssh while RemoteCommand is active results in: "Cannot execute command-line and remote command." instead of having the commandline override the RemoteCommand. which makes it very inconvenient, if not outright confusing and annoying to have it set in your ssh config :(
Quite right: https://github.com/openssh/openssh-portable/commit/1112b534a6a7a07190e497e6bf86b0d5c5fb02dc#diff-5bfa45f3fb322e569a8101399c9c551cR1130 the following would of been sufficient: if (buffer_len(&command) != 0) options.remote_command = NULL;
Created attachment 3067 [details] allow overriding RemoteCommand, allocate TTY Additionally, no TTY is allocated for RemoteCommands by default. Took me a while to figure out why my interactive shells were quite broken :) Both of these can be rectified with the attached patch, if anyone's interested.
Probably best to add that patch to new opened bug. While I could reopen this the new patch is closer to bug fix as opposed to this feature request so might get more attention.
Good point, Daniel. I have done so. See bug 2801.
closing resolved bugs as of 8.6p1 release