Bug 2801 - RemoteCommand: Please allocate TTY, allow overriding command
Summary: RemoteCommand: Please allocate TTY, allow overriding command
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 7.6p1
Hardware: Other Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-26 02:58 AEDT by main.haarp
Modified: 2022-01-14 15:53 AEDT (History)
3 users (show)

See Also:


Attachments
Allocate TTY, allow overriding command (834 bytes, patch)
2017-11-26 02:58 AEDT, main.haarp
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description main.haarp 2017-11-26 02:58:34 AEDT
Created attachment 3097 [details]
Allocate TTY, allow overriding command

Thank you for merging RemoteCommand.

I have two feature requests on top of it.

1. When specifying a command line to ssh while RemoteCommand is active, openssh aborts with:

"Cannot execute command-line and remote command."

I think it would be much better to have a specified command line override RemoteCommand instead. Otherwise it becomes a pain having it active in your config.


2. When using RemoteCommand, no TTY is allocated by default, which makes having shells in RemoteCommand very inconvenient.



I have attached a trivial patch taking care of both.

Also see comment 9 of bug 2103 (https://bugzilla.mindrot.org/show_bug.cgi?id=2103#c9).


Thanks!
Comment 1 Damien Miller 2018-12-07 14:46:14 AEDT
Regarding #2 - does RequestTTY=yes not solve this problem?
Comment 2 main.haarp 2018-12-07 21:28:01 AEDT
(In reply to Damien Miller from comment #1)
> Regarding #2 - does RequestTTY=yes not solve this problem?

Yes, but then RequestTTY must accompany RemoteCommand in every config entry. This isn't always desirable, for example when using a command-line (which is what request 1 in this bug is about).
Comment 3 Luiz Angelo Daros de Luca 2019-02-21 23:26:06 AEDT
The TTY allocation is a minor problem. However, the lack of precedence of cmdline command is a much more complex issue. Users have to use ugly hacks like https://unix.stackexchange.com/questions/451253/how-to-configure-ssh-with-a-remotecommand-only-for-interactive-sessions-i-e-wi

Please, fix this.
Comment 4 Damien Miller 2022-01-14 15:53:08 AEDT
I don't think we should change the precedence, but maybe we could add a "Match command ..." to allow users to specify a RemoteCommand only for cases where none was entered on the commandline.