How to Change the SSH Port in Ubuntu Linux – RDPEXTRA
If you are dealing with a Cheap Linux VPS or trying to constant your Ubuntu Linux RDP server, converting the SSH port is a vital step to enhance protection. By default, SSH operates on RDP port 22, making it an clean intention for computerized attacks. Switching the SSH port to a non-elegant range lets in prevent unauthorized get right of entry to tries. In this manual, we are going to stroll you via the stairs required to alternate the SSH port in your Linux RDP setup.
Why Change the SSH Port?
When the use of a Cheap Linux VPS, your server is exposed to the internet, and attackers regularly test for open ports, in particular port 22 (the default SSH port). Changing the SSH port reduces the risk of brute-strain assaults and hides your Ubuntu Linux RDP service from automated bots that focus on not unusual ports. This easy tweak strengthens your server’s protection without the want for additonal software.
Prerequisites for Changing the SSH Port
Before intending, make certain you have:
- Access to a Cheap Linux VPS or Ubuntu Linux RDP instance.
- Root or sudo get admission to to the server.
- Basic knowledge of the way to use SSH to connect with your Linux RDP surroundings RDP.
Make certain you furthermore mght back up any important facts and hold an lively SSH session open in case something is going wrong at some stage in configuration.
Changing the default SSH port (22) in your Ubuntu Linux server enhances protection by way of reducing publicity to automated attacks. Let’s walk via the process step-with the aid of-step to secure your Cheap Linux VPS or Ubuntu Linux RDP gadget.
Step 1: Check the Current SSH Port
By default, SSH uses port 22. To confirm this, run:
bash
Copy code sudo grep Port /etc/ssh/sshd_config
This will display the port your SSH service currently listens on.
Step 2: Confirm SSH Service Connectivity
Ensure the SSH service is running to prevent connection issues later:
bash
Copy code sudo systemctl status ssh
This command verifies that the service is active and working correctly on your Linux RDP server.
Step 3: Connect to the Remote Server via SSH
Open your terminal and connect to your Cheap Linux VPS or Ubuntu Linux RDP server:
bash
Copy code ssh user@your-server-ip
Make sure you have sudo privileges for the configuration changes ahead.
Step 4: Access SSH Configuration File
Once logged in, open the SSH configuration file for editing:
bash
Copy code sudo nano /etc/ssh/sshd_config
Step 5: Modify SSH Port
In the file, find the line #Port 22
. Uncomment it by removing the #
and change the port to your desired value (e.g., 2222):
bash
Copy code Port 2222
Save the changes and exit the editor.
Step 6: Exit the Remote Server
After making the changes, log out from the remote server:
bash
Copy code exit
This ensures the server is ready for you to reconnect using the new SSH port.
Step 7: Verify Port After Changes
Reconnect to the server using the new port to confirm the configuration is correct:
bash
Copy code ssh -p 2222 user@your-server-ip
Ensure the port is allowed through the firewall:
bash
Copy code sudo ufw allow 2222/tcp sudo ufw reload
Additional Tips for Managing Your Ubuntu Linux RDP Server
- Disable Root Login: For enhanced security, disable direct root login via SSH by setting
PermitRootLogin no
in the/etc/ssh/sshd_config
file. - Use SSH Keys: Instead of relying on passwords, use SSH key-based authentication to further secure your Ubuntu Linux RDP instance.
- Monitor Logs: Regularly check SSH logs on your Cheap Linux VPS (
/var/log/auth.log
) to monitor login attempts and detect suspicious activity.
Conclusion
Changing the SSH port on your Ubuntu Linux RDP server is a truthful manner to beautify safety. This small but effective step can deter brute-pressure assaults, making your Cheap Linux VPS extra resilient to unauthorized get admission to. Make certain to update any firewall rules and continually test the new configuration earlier than logging out. With those measures in region, you can enjoy a greater steady Linux RDP revel in buy rdp.
By following this manual, you could improve the overall safety of your Ubuntu server whilst preserving seamless get right of entry to for far off control.
Leave a Reply