<分区>
这个问题似乎不是关于 a specific programming problem, a software algorithm, or software tools primarily used by programmers 的.如果您认为这个问题是关于 another Stack Exchange site 的主题,您可以发表评论以说明问题可能在哪里得到解答。
关闭 6 年前。
<分区>
这个问题似乎不是关于 a specific programming problem, a software algorithm, or software tools primarily used by programmers 的.如果您认为这个问题是关于 another Stack Exchange site 的主题,您可以发表评论以说明问题可能在哪里得到解答。
关闭 6 年前。
是否可以使用另一个 known_hosts
文件而不是用户的标准 $HOME/.ssh/known_hosts
来运行 SSH?
请注意,SSH 为用户使用原始的$HOME
。如果您尝试更改它,例如
export HOME=some_other_location
它不会影响 SSH 用于查找 known_hosts
的位置。
最佳答案
您可以在 $HOME/.ssh/config
中指定一个替代的 known_hosts 文件或 /etc/ssh/ssh_config
, 参数 UserKnownHostsFile
.
或者,如果您更愿意为特定的 SSH 调用使用替代的 known_hosts 文件,您可以使用 SSH 命令选项 -o UserKnownHostsFile=<alternative known_hosts file>
,例如ssh -o UserKnownHostsFile=~/my_temporary_known_host ssh_host
.
关于ubuntu - ssh 使用 $HOME/.ssh/known_hosts 以外的已知主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10765946/
相关文章:
linux - rsync 无法将文件从服务器 A 同步到服务器 B。服务器 B 正在运行 rsync 守护进程
ubuntu - 错误 2002 使用 Ubuntu 和 XAMPP 在 phpmyadmin 上连接被拒绝
android - 如何在 ubuntu 上的 android studio 2.2 中包含 opencv 和 opencv_contrib 模块?
ruby-on-rails - 有人试过在 Ubuntu 中同时从 RVM 和 deb 安装 Ruby 吗?
postgresql - 使用 SFTP 将数据从 STDOUT 复制到远程机器