# Changing the SSH port

Source: <https://beta.dedicated.com.tr/en/kb/changing-the-ssh-port>  
Last updated: 2026-11-28

Changing your SSH port reduces the security exposure of your server.

1. Open the SSH configuration file:

   ```bash
   pico -w /etc/ssh/sshd_config
   ```

2. Find this line in the file:

   ```text
   #Port 22
   ```

   Remove the `#` at the start and replace `22` with the port number you want to use.

3. Press **Ctrl + X** to save and exit.
4. Restart the SSH service:

   ```bash
   /etc/rc.d/init.d/sshd restart
   ```
