Skip to content

Use bash as the default shell for SSH connect sessions#5002

Open
anton-107 wants to merge 1 commit intomainfrom
anekipelov/ssh-connect-bash-shell
Open

Use bash as the default shell for SSH connect sessions#5002
anton-107 wants to merge 1 commit intomainfrom
anekipelov/ssh-connect-bash-shell

Conversation

@anton-107
Copy link
Copy Markdown
Contributor

Summary

  • Client-side fix: When no remote command is specified, spawnSSHClient now explicitly runs /bin/bash -l with -t for PTY allocation instead of relying on the default login shell from /etc/passwd (which is /bin/sh on Databricks compute images).
  • Server-side fix: Before starting sshd, the server attempts to update /etc/passwd to set bash as the login shell for the current user. This covers IDE connections (VS Code, Cursor) that manage their own SSH sessions and don't go through spawnSSHClient.
  • Both fixes degrade gracefully: the client-side fix only applies when no additional args are passed, and the server-side fix logs a warning and continues if /etc/passwd can't be modified.

Test plan

  • Verified databricks ssh connect --cluster=<id> opens a bash shell (tested manually)
  • Verify databricks ssh connect --cluster=<id> -- ls -la still works (additional args passthrough)
  • Verify IDE connections (VS Code/Cursor) get bash after a fresh server start
  • Verify sftp still works for IDE file operations

This pull request was AI-assisted by Isaac.

The default login shell on Databricks compute images is /bin/sh.
This change ensures users get bash in two ways:

1. Client-side: when no remote command is specified, explicitly
   request /bin/bash -l with PTY allocation instead of relying on
   the default login shell from /etc/passwd.

2. Server-side: attempt to update /etc/passwd to set bash as the
   login shell before starting sshd, which also covers IDE
   connections (VS Code, Cursor) that manage their own SSH sessions.

Co-authored-by: Isaac
@github-actions
Copy link
Copy Markdown

Waiting for approval

Based on git history, these people are best suited to review:

  • @ilia-db -- recent work in experimental/ssh/internal/client/, experimental/ssh/internal/server/

Eligible reviewers: @andrewnester, @denik, @pietern, @renaudhartert-db, @shreyas-goenka, @simonfaltum

Suggestions based on git history. See OWNERS for ownership rules.

@anton-107 anton-107 requested a review from ilia-db April 16, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant