Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] 自動從目標機器建立通道並測試連線的腳本 #14

Open
NatLee opened this issue Mar 22, 2024 · 1 comment
Open

[FR] 自動從目標機器建立通道並測試連線的腳本 #14

NatLee opened this issue Mar 22, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@NatLee
Copy link
Owner

NatLee commented Mar 22, 2024

根據teleport,可以使用腳本直接進行通道的設定

image

感覺我們也可以搞一個

目前新增通道的方法先定義為手動

@NatLee NatLee added the enhancement New feature or request label Mar 22, 2024
@NatLee NatLee self-assigned this Mar 22, 2024
@h-alice h-alice self-assigned this Mar 22, 2024
@NatLee
Copy link
Owner Author

NatLee commented Mar 22, 2024

用GPT解析一下teleport的腳本大概功能


這個腳本是用來安裝和配置 Teleport,一個用於訪問遠程系統和應用的工具。腳本的結構和功能如下:

環境變量和預設值的初始化

腳本開始時定義了一系列的變量和預設值,包括 Teleport 版本、安裝路徑、配置文件的路徑、日誌文件的位置等。這些變量可以根據需要進行調整。

輸入參數的處理

腳本使用 getopts 命令處理命令行參數,允許用戶指定 Teleport 的版本、目標主機名稱、端口、加入令牌等信息。

安裝前的檢查

腳本進行了多項檢查,包括確保腳本以 root 身份運行、檢查目標主機的可連接性、檢查是否已安裝 Teleport 等。

安裝 Teleport

根據用戶提供的參數和系統檢測的結果,腳本將從官方存儲庫下載並安裝 Teleport。支持從 tarball、Debian 或 RPM 包安裝。

配置 Teleport

腳本根據提供的參數生成 Teleport 配置文件,支持多種配置模式,包括應用服務模式、資料庫服務模式等。

啟動 Teleport

根據系統類型,腳本會使用 systemd 或 launchd 服務管理器啟動 Teleport,並確保其開機自啟動。

日誌和清理指令

腳本提供了詳細的日誌輸出,並在腳本結束時提供了清理安裝痕跡的指令。

使用示例

腳本提供了多種參數,允許用戶自定義安裝。例如,使用以下命令安裝特定版本的 Teleport:

./teleport-installer.sh -v 15.0.1 -h proxy.natlee.info -p 443 -j <your_join_token> -c <your_ca_pin_hash>

注意事項

  • 腳本中使用了多個系統和網絡工具,如 curldpkgrpm 等,需確保這些工具在執行腳本的系統上可用。
  • 安裝 Teleport 需要根據系統環境和用戶需求進行適當的配置調整。
  • 使用這個腳本之前,建議仔細閱讀並理解其內容,根據自己的需求進行必要的修改。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants