Skip to content

Instantly share code, notes, and snippets.

@nitanka
Created August 14, 2017 08:03
Show Gist options
  • Save nitanka/7e07e7c7c1fc70a36438a5d491fd7ca9 to your computer and use it in GitHub Desktop.
Save nitanka/7e07e7c7c1fc70a36438a5d491fd7ca9 to your computer and use it in GitHub Desktop.
Ansible: Changing the default ssh port
---
- name: Changing ssh default port
lineinfile:
dest: /etc/ssh/sshd_config
regexp: '^Port\s'
state: present
line: 'Port {{ubuntu_ssh_port}}' #give the port number you want to use
#note we need to restart the ssh service
#existing ssh connection will get disconnected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment