Skip to content
This repository was archived by the owner on Dec 26, 2020. It is now read-only.

Commit fc42747

Browse files
authored
Merge pull request #84 from fullyint/ssh_config_port
List only one Port in ssh config
2 parents 07daa8b + 75d85e9 commit fc42747

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ Warning: This role disables root-login on the target server! Please make sure yo
2424
|`ssh_server_weak_hmac` | false |true if weaker HMAC mechanisms are required. This is usually only necessary, if older M2M mechanism need to communicate with SSH, that don't have any of the configured secure HMACs enabled.|
2525
|`ssh_client_weak_kex` | false |true if weaker Key-Exchange (KEX) mechanisms are required. This is usually only necessary, if older M2M mechanism need to communicate with SSH, that don't have any of the configured secure KEXs enabled.|
2626
|`ssh_server_weak_kex` | false |true if weaker Key-Exchange (KEX) mechanisms are required. This is usually only necessary, if older M2M mechanism need to communicate with SSH, that don't have any of the configured secure KEXs enabled.|
27-
|`ssh_server_ports` | ['22'] |ports to which ssh-server should listen to|
28-
|`ssh_client_ports` | ['22'] |ports to which ssh-client should connect to|
27+
|`ssh_server_ports` | ['22'] |ports on which ssh-server should listen|
28+
|`ssh_client_port` | '22' |port to which ssh-client should connect|
2929
|`ssh_listen_to` | ['0.0.0.0'] |one or more ip addresses, to which ssh-server should listen to. Default is all adresseses, but should be configured to specific addresses for security reasons!|
3030
|`ssh_host_key_files` | ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_dsa_key', '/etc/ssh/ssh_host_ecdsa_key'] |Host keys to look for when starting sshd.|
3131
|`ssh_client_alive_interval` | 600 | specifies an interval for sending keepalive messages |

defaults/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ ssh_server_weak_kex: false # sshd
2020
# If true, password login is allowed. For sshd, it is always set to no password login.
2121
ssh_client_password_login: false # ssh
2222

23-
# ports to which ssh-server should listen to
23+
# ports on which ssh-server should listen
2424
ssh_server_ports: ['22'] # sshd
2525

26-
# ports to which ssh-client should connect to
27-
ssh_client_ports: ['22'] # ssh
26+
# port to which ssh-client should connect
27+
ssh_client_port: '22' # ssh
2828

2929
# one or more ip addresses, to which ssh-server should listen to. Default is empty, but should be configured for security reasons!
3030
ssh_listen_to: ['0.0.0.0'] # sshd

templates/openssh.conf.j2

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ Host {{ host.names | join(' ') }}
2222
Host *
2323

2424
# The port at the destination should be defined
25-
{% for port in ssh_client_ports -%}
26-
Port {{port}}
27-
{% endfor %}
25+
Port {{ ssh_client_port }}
2826

2927
# Identity file configuration. You may restrict available identity files. Otherwise ssh will search for a pattern and use any that matches.
3028
#IdentityFile ~/.ssh/identity

0 commit comments

Comments
 (0)