Skip to content

Instantly share code, notes, and snippets.

@ksingh-scogo
Created December 11, 2025 16:16
Show Gist options
  • Select an option

  • Save ksingh-scogo/a232397e6af96ae1a5d29ee51593343e to your computer and use it in GitHub Desktop.

Select an option

Save ksingh-scogo/a232397e6af96ae1a5d29ee51593343e to your computer and use it in GitHub Desktop.
setup2.sh
#!/bin/bash
set -e
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak.$(date +%s)
sed -i 's/^#\?Port .*/Port 9235/' /etc/ssh/sshd_config
grep -q '^Port 9235' /etc/ssh/sshd_config || echo 'Port 9235' >> /etc/ssh/sshd_config
systemctl restart sshd || systemctl restart ssh
echo "done !!!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment