<h1>OpsCloud v4.0 SSH-Server</h1>

#### 认证
+  认证优先级

```mermaid
flowchart LR;
    id1{{Local PubKey}}--> id2{{GitLab PubKey}}--> id3{{LDAP Password}}
```

::: success
密钥支持RSA，ED25519（推荐）
:::
+  添加个人公钥（若在GitLab中已添加则忽略此步骤）
    + <span style="color: #E00990">`用户信息`</span>-<span style="color: #E00990">`个人详情`</span>-<span style="color: #E00990">`SSH密钥`</span>（编辑-添加公钥）
```bash
# 查看公钥
$ cat ~/.ssh/id_rsa.pub
```

#### 登录 `Opscloud SSH-Server`
+ Mac终端命令行中执行
```bash
# -o StrictHostKeyChecking=no 跳过公钥检查
$ ssh ${username}@${sshServerHost}
                           .__                   .___
  ____ ______  ______ ____ |  |   ____  __ __  __| _/
 /  _ \\____ \/  ___// ___\|  |  /  _ \|  |  \/ __ |
(  <_> )  |_> >___ \\  \___|  |_(  <_> )  |  / /_/ |
 \____/|   __/____  >\___  >____/\____/|____/\____ |
       |__|       \/     \/                       \/ version:4.0

Please type `help` to see available commands
${username} 欢迎使用 Opscloud SSH Server! 
```

#### 帮助命令
```
ssh-server>help
AVAILABLE COMMANDS

Built-In Commands
       help: Display help about available commands
       * stacktrace: Display the full stacktrace of the last error.
       clear: Clear the shell screen.
       quit, exit: Exit the shell.
       version: Show version info

Kubernetes
       list-k8s-deployment: List kubernetes deployment info.
       list-k8s-pod: List kubernetes pod info.
       login-k8s-pod: Login kubernetes pod container [Enter ctrl+d to exit the session]
       show-k8s-pod-log: Show kubernetes pod container log [Enter ctrl+c to exit the session]

Server Commands
       b: List server info on the before page.
       server-login, login, open: Login to the server.
       server-list, ls: List server info.
       n: List server info on the next page.


Commands marked with (*) are currently unavailable.
Type `help <command>` to learn more.
```

#### 命令帮助
+ 查看 `ls` 命令帮助
```bash
ssh-server>help ls
NAME
       ls - List server info.

SYNOPSIS
       ls --name String --ip String --help

OPTIONS
       --name String
       Server
       [Optional]

       --ip String
       IP
       [Optional]

       --help or -h
       help for server-list
       [Optional]


ALSO KNOWN AS
       ls
```