Skip to content

Instantly share code, notes, and snippets.

@pistazie
Created April 7, 2020 13:55
Show Gist options
  • Save pistazie/8671c2fb83800113469b319980d451b9 to your computer and use it in GitHub Desktop.
Save pistazie/8671c2fb83800113469b319980d451b9 to your computer and use it in GitHub Desktop.
Amazon Linux 2 EC2 User Data Initial shell script to change the SSH port the instance listens on
#!/bin/bash -ex
sed -i 's/#Port\s22/Port 8732/' /etc/ssh/sshd_config
systemctl restart sshd.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment