Change SSH Port in Linux#
- Modify the sshd_config configuration file
Content to be modified: Port 10022
- Restart the sshd service
- Check the port information
- Add port 10022 to the open port list of the firewall
Add port:
Persistently configure port 10022 in the open port list.
- Reload the firewall
Command:
Explanation: Reload the firewall to apply the latest configuration.
- Check the firewall's allow status for the port
Command:
Explanation: Check if the firewall has allowed the port.
- View the list of ports allowed by the firewall
Command:
Explanation: View the list of ports allowed by the firewall.
- Connect to the server using Xshell client
After confirming the port modification and opening the firewall, you can use Xshell or other client tools to connect to the server.