-
Notifications
You must be signed in to change notification settings - Fork 259
SSH
The rtinst.sh script makes some configuration changes to ssh. A couple of these have created confusion with some users, so I will explain why the changes were made, and how to revert the changes, if you so choose.
The script assigns a random port between 21000 and 29000. The reason for doing this is to circumvent bot intrusions, which will generally attack the default port 22. Changing the port will not deter a proficient hacker specifically targeting your system, but it will close the default port to countless intrusion attempts from bots.
You can run rtinst.sh using the option -t or --ssh-default to retain port 22 for ssh, but to revert it at another time use the following command, and you can substitute 22 for any port you would rather use:
sudo sed -i "/^Port/ c\Port 22" /etc/ssh/sshd_config sudo service ssh restart