How to ssh to your Amazon Elastic Beanstalk instance?
Well, if it's ec2 or a digital ocean server, it would be a lot easier- you do what you normally do for a linux server.
Elastic Beanstalk(eb) is supposed to facilitate the deployment process.
but the setup/configuration is not that enjoyable, at least according to my experience (with Django)
Okay,
1. configure your security group, find the instance's group and add ssh and port 22 to the inbound tab, allow your IP since Amazon only whitelist ips.
2. create a key pair. It is weird to me that amazon create the .pem (priv+pub?) for you and according to some stackoverflow posts we need to -i this file when we connect to the server. That's not how it works normally, where we keep the private locally and let the server keep the public key, whenever we login we verify the key against each other.
3. need to enable the key-pair for your eb instance.
It supposed to be this simple. However i encoutered all kinds of weird problems.
First, the key pair doesn't seem to work, it kept on asking me for passphrase, which i never got a chance to specify from the amazon console. People say need to edit the file permission to 400 from 644, i was on a windows machine, cygwin doesn't seems to understand our company setting, chmod only added 'everyone' and 'domain' user to it. Tried to chmod from a mac and pasted in dropbox folder, of course, (i was being stupid) dropbox will change the permission cuz it's completely different file systems. The thing is the permission warning might not be the cause at all (Manually changed the windows security settings finally silienced this warning).
So after played around with different key pairs and tried to ssh in from a mac. I figured that changing the associated key-pair from the eb portal might simply not take effect at all (ssh -v hinted that server might not support this public key machanism). On another amazon doc i found that i might need to run eb ssh --setup to reconfigure the key-pair. It will actually rescale your instance: create a new one with the specified key and later on delete the old instance - that's how aws works.
This acutally helped. Notice that a new instance is using a differnt public URL, so be sure to get that new URL from the new instance.
It still kept on asking for passphrase, well, okay let me create my own key pair. Super easy on a mac, ssh-keygen, boom, got new keys, added my passphrase. Yes now that i have the passphrase, what say you? So i uploaded the public key to the aws portal.
(They eb ssh --setup again, waited for a couple of minutes)
Finally, now on my Mac:
ssh -i priv_key ec2-user@ec2-your-ip.compute-1.amazonaws.com
It works!!! Hooray!!!

And your Django project is here:

Strangely, the same command doesn't work on Windows (with openSSH), it still wants that passphrase, but my correct phrase simply won't pass the authentication process. After 3 tries, it rejected me.
[No bother for puTTY which simply uses a differnt format (.ppk) for keys.]
Other notes:
clean the known_hosts
private keys need to be in ~/.ssh folder
puTTY cannot load .pem file, puTTY supports .ppk, use puTTYgen for conversion
How to ssh to your Amazon Elastic Beanstalk instance?的更多相关文章
- How to force https on amazon elastic beanstalk
假设您已在负载平衡器安全组中启用https,将SSL证书添加到负载平衡器,将443添加到负载平衡器转发的端口,并使用Route 53将您的域名指向Elastic Beanstalk环境(或等效DNS服 ...
- AWS Add Key Pair to Elastic Beanstalk Instance 给EB实例加密钥
Go to Elastic Beanstalk -> Configuration -> Security -> Virtual machine permissions -> E ...
- DevOps on AWS之Elastic BeanStalk
Elastic BeanStalk相关概念 童话世界中存在着一种魔力beanstalk(豆荚),种在花盆里可以无限的向上生长,越长越高直达云端.AWS Elastic Beanstalk也采用类似概念 ...
- 利用 AWS Elastic Beanstalk 部署 Wordpress 环境
1. 准备 wordpress 代码 从https://wordpress.org/download/ 将代码压缩包下载到本地, 解压,会有一个 wordpress 目录 复制 wp-config-s ...
- [AWS - EC2] 如何向 Amazon Linux 2 实例传输文件,下载文件。How to send/ download files from Amazon Linux 2 Instance
1. 需要: 安装 WinSCP 2. 需要: PuTTY 生成的ppk格式密钥, 没有的话请移步此文章,完成1, 2, 3步即可. 3. 打开 WinSCP , 如果提示已经有PuTTY配置是否导入 ...
- [AWS - EC2]如何使用 PuTTY 连接到 Amazon Linux 2 实例。How to Connect Amazon Linux 2 Instance from Windows Using PuTTY
1. 下载 PuTTY 2. 安装到任意目录 3. 打开 PuTTYgen (注意不是 PuTTY), 如图: 选择 RSA , 点击 Load. 找到从 AWS 创建实例的时候生成的 key,要选择 ...
- Jetty官方文档翻译
最近在学习Jetty,没有找到合适的资料,所有只能看官方文档了,但是只有英文的,想着自己翻译着学也是学还不如把学习的过程放到网上,也可以给需要的人看,英文水平毕竟有限,也是用有道翻译着来的,不过也加了 ...
- How does java technology relate to cloud computing?
Java Paas shootout (@IBM developer) Cloud computing is always a hot topic around IT field today.Ho ...
- java8 之java.time
Java 8 之 java.time 包 标签: java java8 | 发表时间:2013-10-15 08:29 | 作者:coderbee 分享到: 出处:http://coderbee.ne ...
随机推荐
- spark发行版笔记10
感谢DT大数据梦工厂支持提供技术支持,DT大数据梦工厂专注于Spark发行版定制. 本期概览: 数据接收全生命周期的思考 大数据处理框架中,最重要的就是性能,性能是排在前面的.其次再考虑其他的.因为数 ...
- WireShark网络性能分析
最近生产上出现一个性能问题,表现为:行情延时5s左右.从log一路追查下去,发现是我们自己写的一个行情网关(部署在xx.xx.xx.132)<->第三方的中转网关(部署在xx.xx.xx. ...
- 《Pro Express.js》学习笔记——app.params中间件
app.param中间件用于对URL中的参数进行获取.加工.输出,提供公有逻辑,以达到代码重构的目的. 以下示例采取三个步骤对代码进行重构,app.param中间件的作用非常明显: 不使用中间件 使用 ...
- iOS autoresizing布局
在对UIView以及其子类空间的布局方案有多种,今天温习了一下autoresizing布局 一.了解一下相关知识: 1.UIView其中一个属性为 @property(nonatomic) UIVie ...
- Html标签第二课css
css(Cascading Style Sheet)叠层样式表.用于控制网页样式并允许将样式信息与网页内容分离的一种标记性语言. 一:样式三种控制方法 1.行内样式: <div style=& ...
- 【转载】C/C++中extern关键字详解
1 基本解释:extern可以置于变量或者函数前,以标示变量或者函数的定义在别的文件中,提示编译器遇到此变量和函数时在其他模块中寻找其定义.此外extern也可用来进行链接指定. 也就是说extern ...
- 初学者的python学习笔记2
本来想是先把作业二搞定的,结果发现作业二用的字典,一脸懵逼,还是先搞定第二课吧.其实第二课和第一课内容差不多,据说是第一课的老师去美国了……不管怎么样先整理一下吧. ----------------- ...
- Java泛型学习笔记 - (一)泛型的介绍
一.什么是泛型:泛型的作用是用来规定一个类, 接口或方法所能接受的数据的类型. 就像在声明方法时指定参数一样, 我们在声明一个类, 接口或方法时, 也可以指定其"类型参数", 也就 ...
- mac 下配置tomcat
下面就是一些简单的步骤,帮你把Tomcat7安装在你的Mac上. 下载一个 二进制包: apache-tomcat-7.0.27.tar.gz ,可以在Apache的官方网站找到. 双击解压在你的下载 ...
- iOS开发一个用户登录注册模块需要解决的坑
最近和另外一位同事负责公司登录和用户中心模块的开发工作,开发周期计划两周,减去和产品和接口的协调时间,再减去由于原型图和接口的问题,导致强迫症纠结症状高发,情绪不稳定耗费的时间,能在两周基本完成也算是 ...