> For the complete documentation index, see [llms.txt](https://book.linh.eu.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.linh.eu.org/jian-zhan-ji-shu/ubuntu-xiu-gai-ssh-duan-kou.md).

# ubuntu修改ssh端口

1.打开配置文件

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

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

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

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

3.重启ssh服务：

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

ubuntu修改ssh端口比centos简单。
