> For the complete documentation index, see [llms.txt](https://docs.chjina.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chjina.com/it-zhi-shi-ku/xi-tong-pei-zhi-he-you-hua/linux/ubuntu/ubuntu-an-zhuang-ssh.md).

# Ubuntu安装ssh

### Ubuntu主机联网

#### 1.更新下软件包

```
sudo apt update
```

#### 2.安装ssh服务端

```
sudo apt-get install openssh-server
```

#### 3.查看ssh服务端运行状态

```
sudo systemctl status ssh
```

#### 4.测试 client能否ssh登录到Ubuntu，如不能连接到Ubuntu，尝试放通Ubuntu防火墙

```
sudo ufw allow ssh
```

### Ubuntu主机不能联网

[点击下载离线安装包](https://drive.chjina.com/ISO/Linux/Ubuntu/deb%E5%8C%85/sshd/)

上传到Ubuntu主机内

安装

```
sudo -dpkg dpkg -i openssh-server.deb
sudo -dpkg dpkg -i openssh-sftp-server.deb 
```


---

# 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.chjina.com/it-zhi-shi-ku/xi-tong-pei-zhi-he-you-hua/linux/ubuntu/ubuntu-an-zhuang-ssh.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.
