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?的更多相关文章

  1. How to force https on amazon elastic beanstalk

    假设您已在负载平衡器安全组中启用https,将SSL证书添加到负载平衡器,将443添加到负载平衡器转发的端口,并使用Route 53将您的域名指向Elastic Beanstalk环境(或等效DNS服 ...

  2. AWS Add Key Pair to Elastic Beanstalk Instance 给EB实例加密钥

    Go to Elastic Beanstalk -> Configuration -> Security -> Virtual machine permissions -> E ...

  3. DevOps on AWS之Elastic BeanStalk

    Elastic BeanStalk相关概念 童话世界中存在着一种魔力beanstalk(豆荚),种在花盆里可以无限的向上生长,越长越高直达云端.AWS Elastic Beanstalk也采用类似概念 ...

  4. 利用 AWS Elastic Beanstalk 部署 Wordpress 环境

    1. 准备 wordpress 代码 从https://wordpress.org/download/ 将代码压缩包下载到本地, 解压,会有一个 wordpress 目录 复制 wp-config-s ...

  5. [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配置是否导入 ...

  6. [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,要选择 ...

  7. Jetty官方文档翻译

    最近在学习Jetty,没有找到合适的资料,所有只能看官方文档了,但是只有英文的,想着自己翻译着学也是学还不如把学习的过程放到网上,也可以给需要的人看,英文水平毕竟有限,也是用有道翻译着来的,不过也加了 ...

  8. 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 ...

  9. java8 之java.time

    Java 8 之 java.time 包 标签: java java8 | 发表时间:2013-10-15 08:29 | 作者:coderbee 分享到: 出处:http://coderbee.ne ...

随机推荐

  1. Lyft押重注于苹果编程语言Swift

    Lyft押重注于苹果编程语言Swift 1年后获得丰厚回报BI中文站 8月22日报道 一年多以前,打车应用Lyft做出重大决定,决心押重注于苹果开发的编程语言Swift,用这种编程语言重写其所有iPh ...

  2. Adapter 启动时报错

    如果把Adapter安装到C盘,有时在启动Adapter的时候会抛出java.io.IOException: Cannot run program "C:\tibco\adapter\adr ...

  3. 职工工资管理系统 --C语言

    #include<stdio.h> #include<string.h> #include<stdlib.h> #define NUM 1000 void ente ...

  4. git入门学习

    初步学习笔记. 1.创建仓库:git init 仓库:个人理解为文件存放及版本追踪的容器,对应着一个目录,目录中包含用户的文件及git用来追踪文件版本的一系列文件. 新建并进入HelloWorld目录 ...

  5. 关于C#的内存释放问题

    最近在做一个要循环读取xml文件的功能. 想法是读取一个文件,释放一个文件,这样就不会消耗太多内存. 结果运行起来内存不停涨,最后内存溢出.用gc,disponse,异步都没有用. 后来改成relea ...

  6. QT_BEGIN_NAMESPACE和QT_END_NAMESPACE的作用

    本文根据在网上找到的一些资料总结来的,并加入了一些自己的想法. 在源代码中是这样定义的: # define QT_BEGIN_NAMESPACE namespace QT_NAMESPACE { # ...

  7. 一个有趣的回答(摘自http://www.51testing.com/html/03/n-860703.html)

    假设这有一个各种字母组成的字符串,假设这还有另外一个字符串,而且这个字符串里的字母数相对少一些.从算法上讲,什么方法能最快的查出所有小字符串里的字母在大字符串里都有? 比如,如果是下面两个字符串: S ...

  8. Linux 命令 find

    find命令的基本格式是:find [路径] [选项] [操作]路径是find命令所查找的范围,如用.来表示当前目录,用/来表示根目录,选项用于指定查找条件,如:可以指定按照文件的属主,更改时间文件类 ...

  9. java多线程系列之 synchronized

    一.synchronized基本原理 java的内置锁:每个java对象都可以用做一个实现同步的锁,这些锁成为内置锁.线程进入同步代码块或方法的时候会自动获得该锁,在退出同步代码块或方法时会释放该锁. ...

  10. ref与out之间的区别

    ref和out都是C#中的关键字,所实现的功能也差不多,都是指定一个参数按照引用传递.对于编译后的程序而言,它们之间没有任何区别,也就是说它们只有语法区别. 总结起来,他们有如下语法区别: 1.ref ...