快速连接到您的服务
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"