Skip to content

Instantly share code, notes, and snippets.

@jairojunior
Created November 30, 2018 01:46
Show Gist options
  • Save jairojunior/4c6d559f524d931d2c9699c1291ee00f to your computer and use it in GitHub Desktop.
Save jairojunior/4c6d559f524d931d2c9699c1291ee00f to your computer and use it in GitHub Desktop.
Change SSH port during instance launching
#!/bin/sh
sed -i -e "/^#*[\\s]*Port\\s.*/s//Port 2222/" /etc/ssh/sshd_config
semanage port -a -t ssh_port_t -p tcp 2222
systemctl restart sshd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment