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 setting a different port for the client and the server #240

Open
zedtux opened this issue Feb 14, 2022 · 0 comments
Open

Allow setting a different port for the client and the server #240

zedtux opened this issue Feb 14, 2022 · 0 comments

Comments

@zedtux
Copy link

zedtux commented Feb 14, 2022

Is your feature request related to a problem? Please describe.
I have changed the ports attribute in order to avoid attackers to find it to easily but this cookbook change both the server and client config.
This makes any commands, depending on ssh, to use the server port as client so that a git ls-remote command fails because of the client Port config which isn't 22 anymore.

Describe the solution you'd like
In order to avoid a breaking change, the default['ssh-hardening']['ssh']['ports'] Array should allow integers and Hashes, so that both should work, with the Hash one allowing to tell a port for the sever, and a port for the client like that:

default['ssh-hardening']['ssh']['ports'] = [
  { server: 12345, client: 54321 }
]

or to tell only the sever or the client port:

default['ssh-hardening']['ssh']['ports'] = [
  { server: 12345 }
]

Implementing this is easy and gives flexibility to the operator to configure SSH.

Describe alternatives you've considered

A workaround is to create a file ~/.ssh/config containing Port 22.

Additional context

In my case, I'm deploying a Rails app with Capistrano which first tries the git ls-remote [email protected]:group/project.git and it fails.

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

No branches or pull requests

1 participant