快速連接到您的服務
Fastssh是一個TUI,可讓您通過瀏覽SSH配置來快速連接到服務。
在此處為您的平台下載最新版本,將其提取並將其放入路徑中的目錄中(包裝管理人員即將推出)。例如:
sudo cp fast-ssh /usr/bin/fast-ssh
如果您使用貨物,可以運行cargo install fast-ssh
然後,您可以使用Fast-SSH啟動fast-ssh
。
默認的SSH配置文件應位於~/.ssh/config
。如果您已經有一個已定義某些主機的SSH配置文件,則不必添加任何內容,Fast-SSH只是解析此文件並顯示它。如果您沒有SSH配置文件,也沒有其中定義任何主機,則下面是一個示例,可以幫助您將一個用於快速SSH使用。有關SSH配置文件的更多信息,請訪問以下鏈接:https://linuxize.com/post/usise-the-ssh-config-file/
Host * UpdateHostKeys yes Host Desktop # Name of host you want to connect to, for use with Fast-SSH. HostName 192.168.1.10 # Hostname using an IP address, this can be a public or private one. User YourCoolUsername # Username for the host you want to SSH into. Host Server # Name of host you want to connect to, for use with Fast-SSH. HostName 216.58.214.14 # Hostname using an IP address, this can be a public or private one. User YourCoolUsername # Username for the host you want to SSH into. Host AnotherServer # Name of host you want to connect to, for use with Fast-SSH. HostName example.com # Hostname using a domain name. User YourCoolUsername # Username for the host you want to SSH into. Host RaspberyPi/Arch-Linux # Defined group and name of host for use with Fast-SSH. HostName alarm-pi.local # Hostname using a locally resolved address. User YourCoolUsername # Username for the host you want to SSH into. Host RaspberryPi/Raspbian # Defined group and name of host for use with Fast-SSH. HostName raspbian.lan # Hostname using a locally resolved address. User YourCoolUsername # Username for the host you want to SSH into.
Fast-SSH具有組系統。這使您可以按項目,任務或客戶端對服務器進行分類。要組成一些組,這很簡單,只需將Host
定義為Group/ServerName
(請參見上面的示例中的完整配置),您的組將在FastSSH中顯示。現在,您可以選擇一個組,並僅顯示該組中定義的服務器。現在,您要做的就是啟動快速SSH,選擇您的服務,然後按Enter連接。
文件數據庫存儲在$XDG_CONFIG_HOME/FastSSH/db.ron
( %APPDATA%/FastSSH/db.ron
)中。
當您啟動快速SSH時,該文件將自動創建。該數據庫用於存儲服務的連接數和最後一個連接的日期。
Fast-SSH實現了搜索模式(Fuzzy),該模式允許您鍵入以找到一個主機。要使用它,請按s
,開始鍵入,使用箭頭鍵完成選擇,然後在選擇主機以建立SSH連接後按Enter。如果您希望離開搜索模式並返回“組”模式,請按ESC。
鑰匙 | 行動 |
---|---|
h | 顯示快捷方式面板 |
進入 | 驗證選擇:執行SSH CMD |
選項卡/backtab | 瀏覽您的小組 |
左/右 | 瀏覽您的小組 |
上/下 | 瀏覽主機 |
c | 開關配置顯示模式 |
Pageup/down | 滾動配置 |
s | 啟用搜索模式 |
Esc鍵 | 退出搜索模式 |
問 | 退出快速SSH |
Fast-SSH有一些配置選項。您可以在以下方式找到配置
unix: $XDG_CONFIG_HOME/FastSSH/config.yaml
Windows: %APPDATA%/FastSSH/config.yaml
# This is the default configuration for FastSSH. theme: text_primary: "#b967ff" text_secondary: "#ffffff" border_color: "#b967ff"
如果您是新的Windows終端的用戶,並且在運行快速SSH時會遇到RAW ANSI逃生序列,則必須在運行應用程序之前將術語“環境變量”刪除。在此處閱讀有關此信息的更多信息:CrossTerm-RS/CrossTerm#580
最好的解決方案是創建這樣的別名:
alias fast-ssh="TERM= fast-ssh"