Answers:
您可以config
在主.ssh
目录中创建一个文件,该文件可以指定默认用户,身份文件等并将其分配给可用于连接的别名。
例如,您可以将其放入~/.ssh/config
文件中:
Host example
HostName example.com
User first_last
IdentityFile ~/.ssh/example_rsa
Port 22
RSAAuthentication yes
PubkeyAuthentication yes
Host example2
HostName example2.com
User last_first
# other parameters as needed
然后,您可以在命令行上键入ssh example
或ssh example2
进行连接。
因此,您可以与相关用户为要连接的每台计算机设置一个。然后,只需使用别名即可连接,而无需指定用户。您还可以使用模式来匹配多个主机。
有关更多信息,以及可以在ssh_config手册页中的配置文件中指定的内容的详细信息。
config
文件吗?开头没有点?
根据Rich Adam的回答,我发现了PuTTY,它存储了设置。
它全部存储在注册表树中,您可以在下面找到它HKEY_CURRENT_USER\Software\SimonTatham
(Simon Tatham是PuTTY的开发人员)。
在那里您可以看到如何定义主机。