amazon-web-services - 我无法从脚本 ssh 进入 ec2 实例
问题描述
if [ $1 = 1 ]; then
echo "option 1"
ssh -i swarm-nodes.pem ec2-user@18.255.33.
elif [ $1 = 2 ]; then
ssh -i swarm-nodes.pem ec2-user@18.188.124.
elif [ $1 = 3 ]; then
ssh -i swarm-nodes.pem ec2-user@3.137.220.
fi
将这些 ssh 行中的任何一个复制并粘贴到命令行中都可以正常工作。但是,当作为脚本运行时,即 ./myscript 1,它会超时。所以,我想我会在这里问
解决方案
我从一位好朋友那里听说,使用 DNS 名称而不是 IP 地址是可行的。
推荐阅读
- c# - C# VSTO Excel 自动筛选值和空白
- python - 无法使用 python adodbapi 库建立数据库连接
- sql-server - SQL Server - Recursive Query to Return Distinct Email/Phone Relative to a Given Email
- python - 当我尝试退出应用程序窗口时,Python 返回错误
- selenium - 在 Selenium Webdriver 测试(Python)的 JS 块中调用全局变量
- c++ - 如何将文字字符串输入 istream?
- java - 无法查看通过 Spark SQL 创建的新数据
- amazon-web-services - CloudFormation 自定义资源问题
- apache-camel - camel-opentracing:将行李添加到跨领域作为横切关注点
- python - QListWidget 显示更多项目