为了我的工作,我需要经常在云中创建新的虚拟机。每次我用连接新的远程服务器时ssh
,我都需要像completion-ignore-case on
我~/.inputrc
手动设置一些配置。
无论如何,是否可以设置一次此类配置并在各处运行?
答案1
每次我使用 ssh 连接新的远程服务器时,我都需要在 ~/.inputrc 中手动设置一些配置,例如completion-ignore-case。
在本地或远程计算机上?
对于本地计算机,请参阅 : 中的以下选项.ssh/config
(摘自man 5 ssh_config
):
LocalCommand
Specifies a command to execute on the local machine
after successfully connecting to the server. The
command string extends to the end of the line, and is
executed with the user's shell. Arguments to
LocalCommand accept the tokens described in the
TOKENS section.
The command is run synchronously and does not have
access to the session of the ssh(1) that spawned it.
It should not be used for interactive commands.
This directive is ignored unless PermitLocalCommand
has been enabled.
对于远程命令执行,您可以使用该SendEnv
选项将变量设置INPUTRC
为您专门的(预)工匠 inputrc 文件(请参阅man 1 bash
并搜索 INPUTRC)