Created
November 30, 2018 01:46
-
-
Save jairojunior/4c6d559f524d931d2c9699c1291ee00f to your computer and use it in GitHub Desktop.
Change SSH port during instance launching
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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