AWS setup

This is my log about how to setup a working Linux server on AWS (Amazon Web Services) EC2. It’s totally free for a whole year if you are a new account. Because you get to control everything (almost) on this server, it gives much better flexibility comparing to PythongAnywhere. And since it’s always online, so it’s totally suitable for hosting personal website or running a web crawler, even for day trading scripts.

Setup Ubuntu on AWS

Start an instance of Ubuntu on AWS is easy and straightforward, and lots of blogs online covers this part, so I’m going to skip.

Use PuTTY and private key

Something worth mentioning

  • If trying to use Cygwin, then you should enable permission feature. Since I disabled it because it always mess-up with my scripts, and it doesn’t make much sense to enable it, so I choose PuTTY instead.
  • The process of generating private key may cause some trouble, but after generating one, you can always use it afterwards.
  • If you still want to use username/passwd, the old fasion way and less secure way, to login, just change “PasswordAuthentication” from “no” to “yes” in /etc/ssh/sshd_config

Change SSH port

If your company banned port 22, you may want to change SSH port to make it possible to connect while working. What I did is change “Port” from “22” to “443” in /etc/ssh/sshd_config. Then you can use port 443 to connect to AWS.

After changing the config, “sudo service ssh restart” is needed.

Setup remote GUI desktop

I’ve tried the answer on,, to install vnc4server as VNC server, but failed. So I switched to TighVNC as this post,, suggested, and everything became straightforward.

On AWS, use the following to start a server

vncserver :1 -geometry 1920x1080 -depth 16 -alwaysshared

User the following to end a server session

vncserver -kill :1

On the tool bar of client, there is a button that can switch to full screen mode.

Python environment

Setup iPython Notebook server

I’ve tried Anaconda on Windows, but don’t think it’s a right choice since we already have virtualenv. So except for this different, I followed this post,, and setup my iPython Notebook server. However, I haven’t successfully changed its port from 8888 to 80, yet.

Using Virtualenv for user (not root)

source /usr/local/bin/

Setup Screen on AWS

Use “showkey” to find out what code a particular key or key combination has, then put it in “bindkey” in ~/.screenrc

showkey -a

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s