mirror of
https://github.com/appleboy/ssh-action.git
synced 2025-06-20 16:42:10 +10:00
docs: revamp and unify multi-language readme documentation
- Remove the Table of Contents section to simplify documentation. - Add and reorganize introduction sections for a clearer project overview. - Rename and clarify section titles for improved structure and navigation. - Consolidate and expand explanatory text around SSH key setup, OpenSSH compatibility, security, and troubleshooting. - Provide richer descriptions for core concepts and advanced SSH usage scenarios. - Apply the same documentation improvements and structural changes across English, Simplified Chinese, and Traditional Chinese readme files for consistency. Signed-off-by: appleboy <appleboy.tw@gmail.com>
This commit is contained in:
parent
c7fbbc9208
commit
4d84f0522a
3 changed files with 87 additions and 135 deletions
|
@ -2,44 +2,22 @@
|
|||
|
||||
[English](./README.md) | 繁體中文 | [简体中文](./README.zh-cn.md)
|
||||
|
||||
## 目錄
|
||||
---
|
||||
|
||||
- [🚀 GitHub Actions 的 SSH](#-github-actions-的-ssh)
|
||||
- [目錄](#目錄)
|
||||
- [📥 輸入參數](#-輸入參數)
|
||||
- [🚦 使用範例](#-使用範例)
|
||||
- [🔑 設定 SSH 金鑰](#-設定-ssh-金鑰)
|
||||
- [產生 RSA 金鑰](#產生-rsa-金鑰)
|
||||
- [產生 ED25519 金鑰](#產生-ed25519-金鑰)
|
||||
- [🛡️ OpenSSH 相容性](#️-openssh-相容性)
|
||||
- [🧑💻 更多用法範例](#-更多用法範例)
|
||||
- [使用密碼認證](#使用密碼認證)
|
||||
- [使用私鑰認證](#使用私鑰認證)
|
||||
- [多條指令](#多條指令)
|
||||
- [從檔案執行指令](#從檔案執行指令)
|
||||
- [多主機](#多主機)
|
||||
- [多主機不同埠號](#多主機不同埠號)
|
||||
- [多主機同步執行](#多主機同步執行)
|
||||
- [傳遞環境變數到 shell 腳本](#傳遞環境變數到-shell-腳本)
|
||||
- [🌐 使用 ProxyCommand(跳板機)](#-使用-proxycommand跳板機)
|
||||
- [🔒 保護你的私鑰](#-保護你的私鑰)
|
||||
- [🖐️ 主機指紋驗證](#️-主機指紋驗證)
|
||||
- [❓ 常見問題](#-常見問題)
|
||||
- [指令找不到(npm 或其他指令)](#指令找不到npm-或其他指令)
|
||||
- [🤝 貢獻](#-貢獻)
|
||||
- [📝 授權](#-授權)
|
||||
## 📖 簡介
|
||||
|
||||
一個讓你輕鬆安全執行遠端 SSH 指令的 [GitHub Action](https://github.com/features/actions)。
|
||||
**SSH for GitHub Actions** 是一個強大的 [GitHub Action](https://github.com/features/actions),可讓你在 CI/CD 工作流程中輕鬆且安全地執行遠端 SSH 指令。
|
||||
本專案以 [Golang](https://go.dev) 和 [drone-ssh](https://github.com/appleboy/drone-ssh) 建立,支援多主機、代理、進階認證等多種 SSH 場景。
|
||||
|
||||

|
||||
|
||||
[](https://github.com/appleboy/ssh-action/actions/workflows/main.yml)
|
||||
|
||||
本專案以 [Golang](https://go.dev) 和 [drone-ssh](https://github.com/appleboy/drone-ssh) 建立。
|
||||
|
||||
---
|
||||
|
||||
## 📥 輸入參數
|
||||
## 🧩 核心概念與輸入參數
|
||||
|
||||
本 Action 提供彈性的 SSH 指令執行能力,並具備豐富的設定選項。
|
||||
|
||||
完整參數請參閱 [action.yml](./action.yml)。
|
||||
|
||||
|
@ -85,9 +63,9 @@
|
|||
|
||||
---
|
||||
|
||||
## 🚦 使用範例
|
||||
## ⚡ 快速開始
|
||||
|
||||
在工作流程中執行遠端 SSH 指令:
|
||||
只需簡單設定,即可在工作流程中執行遠端 SSH 指令:
|
||||
|
||||
```yaml
|
||||
name: Remote SSH Command
|
||||
|
@ -121,17 +99,19 @@ linuxserver.io
|
|||
|
||||
---
|
||||
|
||||
## 🔑 設定 SSH 金鑰
|
||||
## 🔑 SSH 金鑰設定與 OpenSSH 相容性
|
||||
|
||||
### 設定 SSH 金鑰
|
||||
|
||||
建議於本地端(非遠端伺服器)產生 SSH 金鑰。請以 GitHub Secrets 指定的使用者名稱登入並產生金鑰對:
|
||||
|
||||
### 產生 RSA 金鑰
|
||||
#### 產生 RSA 金鑰
|
||||
|
||||
```bash
|
||||
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
|
||||
```
|
||||
|
||||
### 產生 ED25519 金鑰
|
||||
#### 產生 ED25519 金鑰
|
||||
|
||||
```bash
|
||||
ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
|
||||
|
@ -175,9 +155,7 @@ xclip < ~/.ssh/id_ed25519
|
|||
> - 設定 `.ssh` 權限為 700
|
||||
> - 設定 `.ssh/authorized_keys2` 權限為 640
|
||||
|
||||
---
|
||||
|
||||
## 🛡️ OpenSSH 相容性
|
||||
### OpenSSH 相容性
|
||||
|
||||
若出現以下錯誤:
|
||||
|
||||
|
@ -199,7 +177,9 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
|
|||
|
||||
---
|
||||
|
||||
## 🧑💻 更多用法範例
|
||||
## 🛠️ 用法場景與進階範例
|
||||
|
||||
本節涵蓋常見與進階用法,包括多主機、代理、環境變數傳遞等。
|
||||
|
||||
### 使用密碼認證
|
||||
|
||||
|
@ -331,7 +311,9 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
|
|||
|
||||
---
|
||||
|
||||
## 🌐 使用 ProxyCommand(跳板機)
|
||||
## 🌐 代理與跳板機用法
|
||||
|
||||
你可以透過代理(跳板機)連線到遠端主機,適用於進階網路拓撲。
|
||||
|
||||
```bash
|
||||
+--------+ +----------+ +-----------+
|
||||
|
@ -376,7 +358,9 @@ Host FooServer
|
|||
|
||||
---
|
||||
|
||||
## 🔒 保護你的私鑰
|
||||
## 🛡️ 安全最佳實踐
|
||||
|
||||
### 保護你的私鑰
|
||||
|
||||
密碼短語會加密你的私鑰,即使外洩也無法被攻擊者直接利用。請務必妥善保管私鑰。
|
||||
|
||||
|
@ -394,9 +378,7 @@ Host FooServer
|
|||
ls -al
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🖐️ 主機指紋驗證
|
||||
### 主機指紋驗證
|
||||
|
||||
驗證 SSH 主機指紋有助於防止中間人攻擊。取得主機指紋(將 `ed25519` 換成你的金鑰型別,`example.com` 換成你的主機):
|
||||
|
||||
|
@ -422,9 +404,11 @@ ssh example.com ssh-keygen -l -f /etc/ssh/ssh_host_ed25519_key.pub | cut -d ' '
|
|||
|
||||
---
|
||||
|
||||
## ❓ 常見問題
|
||||
## 🚨 錯誤處理與疑難排解
|
||||
|
||||
### 指令找不到(npm 或其他指令)
|
||||
### 常見問題
|
||||
|
||||
#### 指令找不到(npm 或其他指令)
|
||||
|
||||
若遇到 "command not found" 錯誤,請參考 [此討論](https://github.com/appleboy/ssh-action/issues/31#issuecomment-1006565847) 了解互動式與非互動式 shell 差異。
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue