To change the SSH port on a Linux system, follow these steps:
1. Log in to your Linux machine as root or with root privileges.
1. Open the main SSH configuration file `/etc/ssh/sshd_config` in your text editor.
1. Locate the line that says `#Port 22` and remove the `#` symbol to make the line active.
1. Change the default port ‘22’ to a different port number of your choice. For example, `Port 2222`.
1. Save the file and exit your text editor.
1. Restart the SSH service. Enter the command: `systemctl restart sshd`
Note: If you are using a Firewall, make sure to update the rules to allow the new SSH port through the firewall as well.