ssh - ssh:无法解析主机名 ubuntu:名称解析暂时失败
问题描述
我正在尝试实现一个 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
推荐阅读
- javascript - EventListener keydown 事件未触发多个键按下
- python - 如何让 models.UUIDField 字段没有破折号
- electron - 如何在浏览器中打开电子应用程序作为本地网站
- c# - 如何替换集合中的元素
- jquery - html5 验证 - 当值不等于某个字符串时有效
- java - JUnit - 编写测试
- swift - 在 TableViewCell 中按下标签时关闭视图
- java - 路由中的apache骆驼多线程
- python - 在关系字段odoo 10的计算中检索字段值
- python-3.x - 当我运行代码时,它给了我一个缩进错误,为什么