<分区>
我在使用 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
来计算公钥。知道哪里出了问题吗?