使用 scp 时出现此错误:
scp -r h1:/dir1 h2:/dir1
ssh: Could not resolve hostname online1: Name or service not known
lost connection
但两者都ssh h1
很好ssh h2
,因为我在 .ssh/config 中有配置名称别名,如下所示:
Host h1
HostName 172.16.18.xxx
User xxx
没有在 /etc/hosts 上进行编辑。我也用来ssh-copy-id
计算公钥。知道出了什么问题吗?