Skip to content

Instantly share code, notes, and snippets.

@benzBrake
Created December 2, 2016 02:16
Show Gist options
  • Save benzBrake/4602f3b8367ea1a85934d58e48a4a013 to your computer and use it in GitHub Desktop.
Save benzBrake/4602f3b8367ea1a85934d58e48a4a013 to your computer and use it in GitHub Desktop.
List SSH Ports
#/bin/bash
SSH_PORTS=`cat /etc/ssh/sshd_config | grep 'Port ' | grep -v '#'`
FIRST_PORT=`echo ${TEST} | head -n 1`
if [ -n ${FIRST_PORT} ];then
echo ${SSH_PORTS}
else
echo 22
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment