> For the complete documentation index, see [llms.txt](https://docs.petrosky.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.petrosky.io/getting-started/tutorials/changing-ssh-port.md).

# Changing SSH Port

Secure Shell Port - Tutorials

## Changing Secure Shell Default Port (22)

The default port number is (22/TCP). You can set the port number of the server according to your requirements. Here is a detailed tutorial on how to do it.

**Step 1:**&#x20;

First of all, you will have to open the SSH configuration file to change the port, thus, execute the following command in the terminal: nano `/etc/ssh/sshd_config`

![](https://1491144344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjV1Qo8RBxPquhVJp7Hkt%2Fuploads%2FJ5jEC94cQXY3vTDM0i4q%2Fimage.png?alt=media\&token=ecb24aba-71d6-411f-a8f4-845d5b8c0392)

Here at my case. I've used Port 3468. You can change 22 to whatever Port you want.

#### Step 2:

Save the changes with the following keys (CTRL+X) then hit 'Y' on your keyboard then 'Enter'. Now the changes are applied.

#### Step 3:

Restart SSH with the following command:&#x20;

service sshd restart

From now on. You will be able to login with your custom SSH Port!
