我正在尝试实现ssh配置文件。刚才它在不同的ec2实例上工作,所以我不确定这里有什么不同。我可以ssh -i "key.pem" ubuntun@ipaddress
很好,但是当我使用配置文件ssh ubuntu
时出现以下错误
debug1: Reading configuration data /home/anders/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
ssh: Could not resolve hostname ubuntu: Temporary failure in name resolution
我的配置如下所示
Host fsdfs.compute.amazonaws.com
User ubuntu
Port 22
IdentitiesOnly yes
IdentityFile ~/.ssh/fds-fds-dsfs.pem
当我在.ssh上运行ls -ld时,drwx------ 2 anders anders 4096 May 26 06:45 /home/anders/.ssh
当我在.ssh / config上运行ls -ld时,我得到-rw------- 1 anders anders 137 May 26 06:26 /home/anders/.ssh/config
希望有人可以提供帮助。提前谢谢
这最终为我工作,除非有人回答为什么我的不工作这是解决方案
Host ubuntu
HostName fsdf.us-east-2.compute.amazonaws.com
User ubuntu
Port 22
IdentitiesOnly yes
IdentityFile ~/.ssh/fds-dfas-fdsa.pem