我正在尝试将我的 ssh_config (CLIENT) 配置为根据同一主机的用户使用不同的密钥文件,但无法使其正常工作。怎么了?它说坏装备
Host myServer
Hostname myServer.net
Match #bad argument at this line
Host myServer
User jhon
IdentityFile ~/.ssh/jhon
Match
User foo
IdentityFile ~/.ssh/foo
---------------------->[已解决]<-------------------- -
Host myServer
Hostname myServer.net
Match user jhon host "myserver.net"
IdentityFile ~/.ssh/jhon
Match user foo host "myserver.net"
IdentityFile ~/.ssh/foo
Host another
User anyOtherOneUser
Hostname another.net
# any other configuration
Match user jhon host "another.net"
IdentityFile ~/.ssh/jhon-another
Match user foo "another.net"
IdentityFile ~/.ssh/foo-another
形成 ssh 手册页:
您使用 结束
Match
语句Host
。条件未大写(例如使用host
而不是Host
)