Created
February 1, 2024 08:22
-
-
Save cdalar/5cc5a20509ab623e135e83f264c3d520 to your computer and use it in GitHub Desktop.
Cloud init file for enabling SSHD on port 443 for Redhat RHEL.
This file contains 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
#cloud-config | |
runcmd: | |
- sudo sed -i 's/Port 22/Port 443/g' /etc/ssh/sshd_config | |
- sudo echo "Port 443" >> /etc/ssh/sshd_config | |
- sudo semanage port -m -t ssh_port_t -p tcp 443 | |
- sudo firewall-cmd --permanent --add-port=443/tcp | |
# - sudo systemctl stop firewalld.service | |
- sudo systemctl restart sshd.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment