我的 ~/.ssh/config 中有以下内容。
HOST 10.2.192.*
USER foo
PreferredAuthentications publickey
IdentityFile ~/.ssh/foo/id_rsa
Run Code Online (Sandbox Code Playgroud)
上面的配置让我在输入一半的单词的同时连接到一台机器。
ssh 10.2.192.x
Run Code Online (Sandbox Code Playgroud)
在我的 ssh 配置之前,我必须输入所有这些:
ssh foo@10.2.192.x -i ~/.ss/foo/id_rsa
Run Code Online (Sandbox Code Playgroud)
但是,我想使用基于密码的身份验证而不是基于密钥的身份验证连接到 10.2.192.x 子网中的一台机器。
因为 ssh 查看我的配置文件并找到匹配项,PreferredAuthentications publickey因为我无法仅使用我的密码登录。
我不打算经常 ssh 进入这个特殊的雪花虚拟机,以保证向我的 ssh 配置添加新规则。
我怎样才能让 ssh 忽略我的配置文件一次,并允许我使用密码进行身份验证?
RFC:
将 SSH URI 表示为:
ssh://[<user>[;fingerprint=<host-key fingerprint>]@]<host>[:<port>]
Run Code Online (Sandbox Code Playgroud)
OpenSSH ssh 命令不遵循此标准的主机名选项是否有任何已知原因?它不接受冒号后的端口。
我期望工作的 URI 示例:
$ ssh user@host:2222
ssh: Could not resolve hostname host:2222: Name or service not known
Run Code Online (Sandbox Code Playgroud) 我正在尝试在 Raspberry Pi 上登录全新安装的 openSUSE Leap 42.2。该设置完全默认,并且 pi 上没有存储公钥。
当我尝试通过登录时ssh root@192.168.1.56出现错误:
Received disconnect from 192.168.1.56 port 22:2: Too many authentication failures
Connection to 192.168.1.56 closed by remote host.
Connection to 192.168.1.56 closed.
Run Code Online (Sandbox Code Playgroud)
使用ssh -v表明正在提供大量公钥:
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/robert/.ssh/id_rsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Offering DSA public key: /home/robert/.ssh/id_dsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Offering RSA public key: robert@XXX
debug1: …Run Code Online (Sandbox Code Playgroud)