User Tools

Site Tools


ubuntu:ssh:change_the_port

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ubuntu:ssh:change_the_port [2023/06/09 16:05] – created peterubuntu:ssh:change_the_port [2025/05/21 09:41] (current) peter
Line 1: Line 1:
 ====== Ubuntu - SSH - Change the Port ====== ====== Ubuntu - SSH - Change the Port ======
  
-<code bash> +Edit the **/etc/ssh/sshd_config** file, and change the **Port**:
-sudo vi /etc/ssh/sshd_config +
-</code> +
- +
-and change the **Port**:+
  
 <file bash /etc/ssh/sshd_config> <file bash /etc/ssh/sshd_config>
 Port <change to another port other than 22> Port <change to another port other than 22>
-PermitRootLogin no 
 </file> </file>
  
Line 17: Line 12:
  
 <code bash> <code bash>
 +sudo systemctl restart ssh
 +
 +or
 +
 sudo /etc/init.d/ssh restart sudo /etc/init.d/ssh restart
 </code> </code>
 +
 +----
 +
 +<WRAP TIP>
 +**NOTE:**  Remember to update firewall rules accordingly and ensure the new port is not used by another service.
 +</WRAP>
  
ubuntu/ssh/change_the_port.1686326741.txt.gz · Last modified: 2023/06/09 16:05 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki