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

allow ssh non-interactive login to source bashrc #69

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

IgorTodorovskiIBM
Copy link
Collaborator

@IgorTodorovskiIBM IgorTodorovskiIBM commented Jan 26, 2024

    # When built with SSH_SOURCE_BASHRC, bash will source ~/.bashrc when
    # it's non-interactively from sshd.  This allows the user to set
    # environment variables prior to running the command (e.g. PATH).  The
    # /bin/bash that ships with macOS defines this, and without it, some
    # things (e.g. git+ssh) will break if the user sets their default shell to
    # Homebrew's bash instead of /bin/bash.
    ENV.append_to_cflags "-DSSH_SOURCE_BASHRC"
  • My ubuntu machine also seems to have this enabled.

New behaviour:

ssh -i~/.ssh/id_rsa_jenkins [email protected] "ls"
<sources .bashrc>
<lists my files>

Previous behaviour:

ssh -i~/.ssh/id_rsa_jenkins [email protected] "ls"
<does not SOURCE .bashrc>
<lists my files>

@IgorTodorovskiIBM IgorTodorovskiIBM changed the title allow ssh login to source bashrc allow ssh non-interactive login to source bashrc Jan 26, 2024
Copy link
Collaborator

@MikeFultonDev MikeFultonDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please update the bash FAQ so people know...

@IgorTodorovskiIBM IgorTodorovskiIBM merged commit 1b8445d into main Jan 26, 2024
1 check passed
@IgorTodorovskiIBM IgorTodorovskiIBM deleted the ssh_login branch January 26, 2024 18:56
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.

2 participants