steve's SSHD Port Change

Supports: CentOS 5.9/6.5 with cPanel (pre-installed) (64-bit), 6 (32-bit and 64-bit); Debian 7.0 (32-bit and 64-bit); Ubuntu 12.04 LTS/14.04 LTS (32-bit and 64-bit)

Source Code

#!/bin/bash

# <?env name="sshd_port" label="SSH Port" example="New port to be used for SSH connections" default="22" ?>

function configure_ssh_port {
sed -i "s/^Port .*/Port $SSHD_PORT/" /etc/ssh/sshd_config
test -e /etc/init.d/ssh && /etc/init.d/ssh restart
test -e /etc/init.d/sshd && /etc/init.d/sshd restart
}

configure_ssh_port
Preload Preload Preload