> For the complete documentation index, see [llms.txt](https://docs.lynxlayers.me/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lynxlayers.me/docs/linux-server/change-ssh-ports.md).

# Change SSH Ports

Open SSH Configuration File (sshd) :

```
sudo nano /etc/ssh/sshd_config
```

2. Find the line that reads **#Port 22** or **Port 22**:

<figure><img src="/files/DU6NYrHapWNhsDnmSc1d" alt=""><figcaption><p>Look at Port 22</p></figcaption></figure>

3. Replace it with **New Port** :

<figure><img src="/files/24oArV1XNBlVvkaIZhnQ" alt=""><figcaption><p>Replace it with New Port</p></figcaption></figure>

4. Restart SSH service by the following commands:

```
sudo service ssh restart
```

or

```
sudo systemctl restart ssh
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lynxlayers.me/docs/linux-server/change-ssh-ports.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
