Skip to content

fix: clear RemoteCommand on every non-interactive path - #29

Merged
uhs-robert merged 1 commit into
mainfrom
fix/27-remote-command
Sep 11, 2026
Merged

uhs-robert merged 1 commit into
mainfrom
fix/27-remote-command

Conversation

@uhs-robert

@uhs-robert uhs-robert commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Closes #27.

The failure is earlier than the issue describes. build_batch_command, build_home_command and build_auth_command all append a command (exit, readlink -f $HOME ...), and OpenSSH refuses to run that alongside a config RemoteCommand: Cannot execute command-line and remote command. So authentication fails before a mount is attempted, which is why the host looks reachable everywhere except the mount.

Those paths now pass -o RemoteCommand=none, as does the ssh command handed to sshfs, since sftp needs a plain session. :SSHTerminal without a path still honours the directive; with a path it cannot, because the cd collides the same way.

Verified against a real config: without the flag ssh refuses outright, with it the command runs and fails only at DNS.

Note -o RemoteCommand=none only wins because command-line options outrank config ones, it does not override an earlier -o on the same line.

OpenSSH refuses to run a config RemoteCommand alongside a command line,
so batch auth failed before a mount was ever attempted, and sftp needs a
plain session regardless. A bare terminal still honours the directive.

Closes #27
@uhs-robert
uhs-robert merged commit 1afb8b7 into main Sep 11, 2026
3 checks passed
@uhs-robert
uhs-robert deleted the fix/27-remote-command branch September 11, 2026 02:01
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.

RemoteCommand in ssh_config breaks sshfs mounts

1 participant