INNER CODE UNIT · Shell
SSH_PORT
magenx/Magento-2-server-installation · magenx.install.latest.sh:443
SSH_PORT=$(shuf -i 9537-9554 -n 1)
tee ${OVERRIDE_DIR}/20-magenx-custom-port.conf << EOF
Port ${SSH_PORT}
EOF
YELLOWTXT "Changed SSH port from 22 to ${SSH_PORT}"
fi
chmod 600 ${OVERRIDE_DIR}/*magenx*.conf
systemctl restart sshd.service
_space 1
GREENTXT "SSH configurations were updated - OK"
_space 1
GREENTXT "[!] SSH Port: ${SSH_PORT}"
_space 1
systemctl restart sshd.service
ss -tlp | grep sshd
_space 2