[Bug 2558] New: Add RemoteCommand option to ssh client

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Sat Mar 26 11:00:06 AEDT 2016


https://bugzilla.mindrot.org/show_bug.cgi?id=2558

            Bug ID: 2558
           Summary: Add RemoteCommand option to ssh client
           Product: Portable OpenSSH
           Version: 7.2p1
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: ssh
          Assignee: unassigned-bugs at mindrot.org
          Reporter: main.haarp at gmail.com

Something I am sorely missing in the OpenSSH client is the ability to
automatically run a command on the remote end after the connection is
established. I am proposing a RemoteCommand config option that works
like LocalCommand, but on the remote end.

The use case is to have often-needed commands be executed without
having to specify them on the command line (as this necessitates
searching the shell history or defining aliases). Instead, it should be
possible to do this centralized and easy to maintain from the ssh
config.

There are numerous cases where this could come in handy:
 - Replace your shell in environments where your user's system shell
can't be changed (e.g. embedded systems)
- Execute commands on each login, without having to modify anything on
the remote end (e.g. this guy: http://unix.stackexchange.com/q/214004)
 - Execute a shell with special options (e.g. have it use my local
bashrc automatically)
- Connect to your screen/tmux session immediately after login
- etc

A cursory search for "ssh automatically run script on login" reveals
that this is an often requested feature, which is usually solved by
modifying the server end.

Handling this on the remote end (either with command=... in authorized
keys or by modifying the shell rcfile) is possible, but not a good
solution. It's harder to maintain, not centralized, and you cannot
simply change the command without logging in first. command=... also
only works with OpenSSH servers.

Therefore, I think RemoteCommand would be a sensible and useful
addition to the SSH client.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list