If you are using WHM & CSF, under CentOS, you may follow this steps to change SSH port from 22 (default) to something else 🙂
- First, edit this file
You can use vi
- Find this line
Change to your chosen port, and remove the comment ( # sign )
- Restart the SSH service.
service sshd reload
- Now we must allow incoming data in the new port. Open your WHM >> Plugins >> CSF.
- Click “Firewall Configuration” button.
- Add your new port in “TCP_IN” and “TCP_OUT”.
- Click “Change” button in the bottom of the page.
- You will be asked to restart CSF & LFD. Do it.
- It’s done 🙂