Skip to content

Instantly share code, notes, and snippets.

@cdalar
Created February 1, 2024 08:22
Show Gist options
  • Save cdalar/5cc5a20509ab623e135e83f264c3d520 to your computer and use it in GitHub Desktop.
Save cdalar/5cc5a20509ab623e135e83f264c3d520 to your computer and use it in GitHub Desktop.
Cloud init file for enabling SSHD on port 443 for Redhat RHEL.
#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