# 如何连接

在 Clore.ai 上租用 GPU 服务器后，您可以通过 SSH 连接或访问预装的服务，如 Jupyter Notebook。

## 连接信息

订单激活后，您可以在以下位置找到连接详情：

1. **我的订单** 页面 → 点击您激活的订单
2. **订单详情** 将显示：IP 地址、SSH 端口和凭据

## SSH 连接

### Linux / macOS

打开终端并运行：

```bash
ssh root@<IP_ADDRESS> -p <PORT>
```

示例：

```bash
ssh root@185.123.45.67 -p 22022
```

### Windows

**使用 PowerShell：**

```powershell
ssh root@<IP_ADDRESS> -p <PORT>
```

**使用 PuTTY：**

1. 下载 [PuTTY](https://putty.org)
2. 在“Host Name”中输入 IP 地址
3. 在“Port”中输入端口号
4. 点击“Open”
5. 以以下身份登录 `root` 使用提供的密码

## SSH 密钥（推荐）

若要无密码登录，请添加您的 SSH 公钥：

1. 转到 **帐户** → **SSH 密钥**
2. 点击 **添加密钥**
3. 粘贴您的公钥（通常位于 `~/.ssh/id_rsa.pub`)
4. 保存

您的密钥将自动部署到新的租用实例。

### 生成 SSH 密钥（如果您没有）

```bash
ssh-keygen -t rsa -b 4096
```

## Jupyter Notebook 访问

许多镜像已预装 Jupyter：

1. 在订单详情中查看 Jupyter 的 URL
2. 在浏览器中打开该 URL（通常为 `http://<IP>:<JUPYTER_PORT>`)
3. 输入订单详情中显示的 token

## 文件传输

### 使用 SCP

上传文件到服务器：

```bash
scp -P <PORT> /local/file.txt root@<IP>:/remote/path/
```

从服务器下载文件：

```bash
scp -P <PORT> root@<IP>:/remote/file.txt /local/path/
```

### 使用 rsync

用于更大文件传输或同步目录：

```bash
rsync -avz -e "ssh -p <PORT>" /local/folder/ root@<IP>:/remote/folder/
```

## 端口转发

要在本地访问服务器上运行的服务：

```bash
ssh -L 8080:localhost:8080 root@<IP> -p <PORT>
```

这会将服务器的 8080 端口转发到您本地的 8080 端口。

## 常见问题

| 问题      | 解决方法                                 |
| ------- | ------------------------------------ |
| 连接被拒绝   | 检查服务器是否已完全启动（订单开始后等待 2-3 分钟）         |
| 权限被拒绝   | 验证密码/SSH 密钥是否正确                      |
| 连接超时    | 检查端口是否正确                             |
| 主机密钥已更改 | 移除旧密钥： `ssh-keygen -R [<IP>]:<PORT>` |

## 连接后有用的命令

检查 GPU 状态：

```bash
nvidia-smi
```

检查可用磁盘空间：

```bash
df -h
```

检查系统资源：

```bash
htop
```


---

# 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://docs.clore.ai/clore.ai/clore.ai-eng-zh/zhen-dui-zu-yong-zhe/how-to-connect.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.
