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

Connectbot terminal view hangs if the host has command="/some/command",no_pty in authorized_keys #1306

Open
WildPenquin opened this issue Oct 5, 2023 · 0 comments
Labels

Comments

@WildPenquin
Copy link

WildPenquin commented Oct 5, 2023

Bug description

I'm trying to a host where I've limited the user to only run one allowed command. Hence, I have on the host $HOME/.ssh/authorized_keys:

command="/my/command",restrict ssh-ed25519 THEKEY....ENDS MyName

However, after connecting with connectbot and authenticating, connectbot - or more specifically the connection terminal - hangs. The command is never ran. I can see from the host logs the authentication succeeded.

Other clients can connect correctly to a host configured this way (to run the command).

If I remove restrict from authorized_keys, the command will run correctly. I've noticed the culprit is no_pty option of sshd. However, remowing no_pty is not optimal.

Steps to reproduce

  1. Create an ssh key pair (or use an already existing one)
  2. set up a host with an authorized_keys with a line similar to this: command="/my command",restrict ssh-ed25519 THEPUBKEY....ENDS MyName, with the public key from step one.
  3. Connect to this host with ConnectBot

You may try to connect with other clients (they will succeed), or remove "restrict" from authorized_keys (no-port-forwarding, no-X11-forwarding, no-agent-forwarding seem to have no ill effects). All these will succeed (to demonstrate pinpoint the bug).

Expected behavior

Connectbot should connect correctly after authenticating.

Android device

  • Device: Fairphone 4
  • OS: Android 12, FP4.SP2K.B.089.20230807
  • ConnectBot Version: 1.9.9

Server information

  • OS: OpenWRT-22.03
  • SSH Software and Version: Dropbear v2022.82
  • Pubkeys used: ssh-ed25519
@WildPenquin WildPenquin added the bug label Oct 5, 2023
@WildPenquin WildPenquin changed the title Connectbot connection window hangs if the host has command="/some/command",restrict in authorized_keys Connectbot connection window hangs if the host has command="/some/command",no_pty in authorized_keys Oct 5, 2023
@WildPenquin WildPenquin changed the title Connectbot connection window hangs if the host has command="/some/command",no_pty in authorized_keys Connectbot terminal view hangs if the host has command="/some/command",no_pty in authorized_keys Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant