change SSH Port

17 views
Skip to first unread message

Janis Heller

unread,
Sep 5, 2016, 10:10:30 PM9/5/16
to Ansible Project
I would like to use ansible to change some things, when I setup a new server.
For this I would need to change for example SSH port.

Using ansible to change the SSH port from default isn't hard:

- name: Setup selinux for alternate SSH port
  seport:
    ports: "2222"
    proto: "tcp"
    setype: "ssh_port_t"
    state: "present"

How to use ansible and self update the SSH port now for this host in my inventory file, so on next time I run a playbook on this host I won't need to change SSH port manually. All I found using google were bad solutions.

-All the best;

Reply all
Reply to author
Forward
0 new messages