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

Implement ssh --forward-agent | -x functionality #521

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

Exhar
Copy link

@Exhar Exhar commented Jan 22, 2025

This pull request addresses and resolves issue #252 by implementing the capability to enable SSH agent forwarding during an SSH session, with the egress key added to the agent.

The behavior is controlled by the sshAddKeysToAgentAllowed configuration option in bastion.conf, which is set to false by default. When this option is explicitly set to true, users can request SSH agent forwarding by including either the --forward-agent or -x argument on egress SSH sessions:

ssh --forward-agent <username>@<host>  
ssh -x <username>@<host>  

This enhancement provides users with greater flexibility while maintaining the secure default settings and addresses the exact scenario described in #252.

Tests have been added in its own file, as I couldn't really find a more appropriate location to add the tests.

@speed47
Copy link
Collaborator

speed47 commented Jan 31, 2025

Hey @Exhar, thanks for looking into it!

I'm just back from holidays so I'll look into your PR in the next few days, in the meantime, triggering test workflows on it. It's completely OK to have created a specific test file btw.

@speed47 speed47 added tests:short Launch tests (deb12 only, w/o cc) tests:full Launch tests (multi-distros multi-versions, w/ cc) tests:freebsd Launch FreeBSD tests only labels Jan 31, 2025
@speed47 speed47 force-pushed the feature_ssh_agent_forwarding branch from b7621d9 to f1f9a97 Compare February 5, 2025 09:58
@speed47
Copy link
Collaborator

speed47 commented Feb 5, 2025

LGTM, just fixing the tests for FreeBSD (upped to v14.2 as v13.2 is no longer supported)

@speed47 speed47 force-pushed the feature_ssh_agent_forwarding branch 5 times, most recently from 0f2c0b2 to f18c542 Compare February 5, 2025 16:31
@speed47 speed47 force-pushed the feature_ssh_agent_forwarding branch from f18c542 to 57a3f33 Compare February 6, 2025 08:09
@speed47 speed47 merged commit c9503f5 into ovh:master Feb 6, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests:freebsd Launch FreeBSD tests only tests:full Launch tests (multi-distros multi-versions, w/ cc) tests:short Launch tests (deb12 only, w/o cc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants