# ubuntu修改ssh端口

1.打开配置文件

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

2.在#Port 22下面增加一行

```
Port 8990  #数字为自己要设置的端口号
```

修改端口不能和已有的服务端口相同。

3.重启ssh服务：

```
/etc/init.d/ssh restart
```

ubuntu修改ssh端口比centos简单。


---

# Agent Instructions: 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://book.linh.eu.org/jian-zhan-ji-shu/ubuntu-xiu-gai-ssh-duan-kou.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.
