Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send post login string as SSH command when no shell session is requested. #1384

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

s3lph
Copy link

@s3lph s3lph commented Mar 30, 2024

There is currently no way for ConnectBot to send a command to a SSH server without allocating a PTY. The "post login string" is only ever sent if a PTY is requested and allocated, and then it is simply sent as an input to the PTY. Issue #1128 describes a similar, if not identical issue.

This is especially limiting if a remote SSH server only permits executing commands. Probably the most common example is OpenSSHd's ForceCommand option: It requires any command (or a shell) to be started before ForceCommand takes effect. ConnectBot, however, won't start a shell unless PTY allocation succeeds.

This PR adds the following feature: If establishing a session is disabled, but a post login string is provided, the post login string is executed as a command through SSH, rather than being piped into a shell. The local and telnet transports implement post login string handling in this scenario as well, but they simply forward it to their write method in the same way the TransportBridge.injectString method already does.

@CLAassistant
Copy link

CLAassistant commented Mar 30, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants