如何在亚马逊 AWS EC2建立一个Debian服务器

标签: aws
1585人阅读 评论(0) 收藏 举报
分类:

Introduction

This guide will cover the basic setup of an Amazon AWS account including sign up, creation and configuration of an EC2 instance.

To create an Amazon AWS account, you need:

  • e-mail address
  • credit card
  • phone number

To follow this guide, you will need these additional software downloads.

  • putty.exe for SSH connection
  • puttygen.exe to create keys for login
  • pageant.exe to load the created keys

Key creation

Before we start with Amazon AWS, let’s create our login keys with puttygen.exe.
这里写图片描述
1. Start puttygen.exe. Choose RSA and 2048 bits from the bottom.
2. Click on “Generate”
3. Choose a “Key comment” (for example: name of your node)
4. Choose a “Key passphrase” and confirm it
5. Save the public key & private key files
6. Close puttygen

Signup

Open the Amazon AWS signup website and click “Create an AWS Account”.
这里写图片描述
Choose “I am a new user,” and enter your e-mail address.
这里写图片描述
Type your e-mail address again and enter your password.
这里写图片描述
Enter your contact information and agree to the terms of service.
这里写图片描述
Enter your payment information.
这里写图片描述
Enter the security check characters and your telephone number. After pressing the button “call me now” you will see a code and receive a phone call. Enter this code on your telephone’s keyboard.
这里写图片描述
After entering the right code, you will see this screen.
这里写图片描述
Select a support plan. For expample “basic”.
这里写图片描述
Before logging in the first time, wait until the “Welcome to Amazon Web Services” email arrives.
这里写图片描述

First log in

Click on the link “Getting Started Resources” in the email you received.
这里写图片描述
You can also use this link https://console.aws.amazon.com/
Click on “Sign in to the Console”.
这里写图片描述
Enter your email and password.
这里写图片描述

Importing a Public Key

Select “EC2” in the “AWS Services” box.
这里写图片描述
Select “Key Pairs” in the “Network & Security” Section.
这里写图片描述
Select “Import Key Pair”.
这里写图片描述
Select your public key file (created in the begin of this guide with puttygen).
这里写图片描述
Define a key pair name and press “Import”.
这里写图片描述

Launch an EC2 Instance

Move to the “EC2 Dashboard” and press “Launch Instance”.
这里写图片描述
Go to “AWS Marketplace”, search for “Debian” and select it from the list.
这里写图片描述
Choose “Debian GNU/Linux 8 (Jessie)” and click create.
这里写图片描述
Choose an instance type. For operating a Supernode, we recommend using at least a “t2.small” instance. To continue, click on “configure instance details”.
这里写图片描述
Use the default settings and click on “add storage.”
这里写图片描述
Use the default settings and click on “add tags”.
add storage
add storage
Click to “add a name tag”.
name tag
name tag
Enter your desired server name in the value column. E.g. “Supernode”
To go on click “Configure Security Group”
server name
server name
Add the following rules:
Type: Custom TCP, Port Range: 7890, Source: Anywhere (for NIS)
Type: Custom TCP; Port Range 7880, Source: Anywhere (for servant)
Type: Custom TCP, Port Range 7778, Source: Anywhere (for light wallets)
Notice: For security reasons, you may restrict SSH access by entering your IP-address instead of 0.0.0.0/0 in the first row.
configure security group
configure security group
Now select the key pair you have uploaded in the “importing a public key” section of this guide and click on the checkbox to acknowledge that you have access to the private key file (you already created the private key in puttygen in the first section of this guide). Finally, click on “Launch Instance”!
select an existing key pair
select an existing key pair
After launching, you will see a screen indicating the launch status. Click on “View Instances”.
launch status
launch status
Write down the Public DNS. E.g. ec2-XX-XX-X-XXX.us-east-2.compute.amazonaws.com
public dns
public dns
Connecting to your new EC2 Instance
After setting up the instance, we will try to connect to our server.
Start pageant.exe and open “View Keys” from the tray icon.
pageant
pageant
Click on “Add Key” and select your saved private key (.ppk) you created earlier with puttygen. After the key is loaded, you can minimize pageant to tray (but don’t shut it down, it needs to run in the background).
Start putty.exe.
pageant
pageant
Start putty and navigate to “Connection - SSH - Auth”. Browse for your private key file (.ppk).
putty auth key
putty auth key
Navigate to “Connection - Data” and input “admin” in the auto-login username field.
putty data
putty data
Go to “Session” and enter your instance Public DNS (E.g. ec2-XX-XX-X-XXX.us-east-2.compute.amazonaws.com, not your instance IP-address) in the “host name” field. Save the session (optional) and click “Open”.
putty host name
putty host name
A console will open. A username and password are not needed, it will automatically load your username from putty and your key from pageant!
Root access
By default, the user root is deactivated. To activate, log in as a standard user.
Type the following in the console:
sudo su -
Set a root password with:
passwd
After setting a password, the root user is activated. To login to your EC2 instance you will still need the standard user (with RSA-key login), but as soon as you are logged in, you can change to root with:
su
Install Supernode
The EC2 instance is now ready for installation.
For the Installation, we will use Paul’s guide (click here), since it has covered everything.
There is one value which you have to change: From section 1.3 change:
Java -Xms768M -Xmx768M
to:
Java -Xms1024M -Xmx1024M
Other than that you can follow the guide, and your supernode will be set up correctly!

查看评论

云数据迁移:将数据迁移到AWS的6种策略

-
  • 1970年01月01日 08:00

阿里云debian服务器升级php到7.0

在/etc/apt/source.list文件里添加以下内容:deb http://packages.dotdeb.org jessie all deb-src http://packages.dot...
  • turtleo
  • turtleo
  • 2017-01-08 12:20:44
  • 1764

AWS EC2 Instances Type

General Purpose Instances General Purpose instances  provide customers with a balanc...
  • screaming
  • screaming
  • 2016-05-09 16:31:45
  • 408

连不上EC2上部署的服务时的检查步骤

下面的步骤用来诊断EC2上部署的服务是否正常,分Linux 和 windows两个部分。 Linux 1. 登录部署服务的EC2服务器,检查端口是否已正常监听    例如,检查80端口 n...
  • aws0to1
  • aws0to1
  • 2015-08-31 13:10:35
  • 2288

使用Amazon EC2及OpenVPN搭建属于自己的VPN服务器

严正声明:本文旨在为技术爱好者提供AWS及OpenVPN的搭建指南,为技术交流目的,请勿以任何方式转载或非法谋取利益。 今天我来给各位介绍一下如何使用Amazon云服务器来搭建属于自己的免费VPN服...
  • lgyaxx
  • lgyaxx
  • 2018-02-08 16:23:09
  • 14161

Amazon EC2云端服务器的使用方法

Amazon的EC2服务器可以理解为虚拟机,不过它是不需要安装系统的,它是根据镜像自动创建的。在申请EC2的时候,可以选择操作系统的类型,如Redhat Enterprise 6或ubuntu 12等...
  • michael1112
  • michael1112
  • 2016-09-14 11:58:53
  • 2634

在AWS上搭建tomcat服务器

最近项目需要在云上搭建了一个tomcat服务器,选择的是亚马逊的1年免费试用。 总结一下以后需要注意的地方: 1.注意安全组配置一定要符合当前的ip,测试的时候可以设置成允许所有流量,出站默认就是...
  • xiaonannanxn
  • xiaonannanxn
  • 2016-08-27 16:36:12
  • 1787

亚马逊EC2建立虚拟机并使用ssh连接

登录亚马逊AWS后,在页面右上角可以选择服务节点,可选择最快的服务器地址,服务器列表可参考此页面:http://ec2-reachability.amazonaws.com,通过ping页面里各节点地...
  • jewely
  • jewely
  • 2017-09-19 14:55:43
  • 5069

亚马逊云aws上运行jupyter notebook(python)

  • 2017年08月14日 11:24
  • 416KB
  • 下载

通过Amazon EC2来搭建基于pptpd协议的VPN服务器

近期注册了AWS提供了一年的免费服务,由于国内不能上goole,我们在这里来搭建一个属于自己的vpn服务器,让我们可以随时进行goole以及一些国内限制网站的访问,使用AWS云服务器为Red Hat ...
  • xuxingzhuang
  • xuxingzhuang
  • 2016-05-17 18:43:30
  • 14035
    个人资料
    持之以恒
    等级:
    访问量: 3万+
    积分: 552
    排名: 9万+
    最新评论