我在我的~/..ssh/config中有以下内容。
HOST 10.2.192.*
USER foo
PreferredAuthentications publickey
IdentityFile ~/.ssh/foo/id_rsa以上配置允许我在输入一半单词时连接到一台机器。
ssh 10.2.192.x在ssh配置之前,我必须输入以下所有内容:
ssh foo@10.2.192.x -i ~/.ss/foo/id_rsa但是,10.2.192.x子网中有一台机器,我想用基于密码的身份验证来连接,而不是基于密钥的身份验证。
因为ssh查看我的配置文件并找到了PreferredAuthentications publickey的匹配项,所以我无法只使用我的密码登录。
我不打算把ssh放到这个特殊的雪花vm中,经常需要在我的ssh配置中添加一个新规则。
如何使ssh只忽略我的配置文件一次,并允许我使用密码进行身份验证?
发布于 2014-01-21 18:35:28
若要使ssh客户端忽略配置文件,请使用ssh -F /dev/null username@example.com。因为您的子网的IdentityFile是在~/.ssh/foo而不是~/.ssh/中,所以您不需要编写一个全新的文件来避开现有的私钥。
来自ssh手册页:
-F configfile
Specifies an alternative per-user configuration file. If a
configuration file is given on the command line, the system-wide
configuration file (/etc/ssh/ssh_config) will be ignored. The default
for the per-user configuration file is ~/.ssh/config.发布于 2014-01-21 18:58:16
我相信如何强迫ssh客户端只使用密码?已经回答了这个问题
ssh -o PubkeyAuthentication=no example.comhttps://unix.stackexchange.com/questions/110283
复制相似问题