QuyetDoan.Net
  • Trang chủ
  • Chứng khoán
    • Phân tích kỹ thuật
      • Tổng quan phân tích kỹ thuật
      • Sóng Elliott
    • Candlesticks
      • Giới thiệu Candlestics
      • Mẫu hình nến đảo chiều
      • Mẫu hình nến tiếp diễn
    • Indicator
      • Chỉ báo dao động
      • Hỗ trợ và kháng cự
      • Chỉ báo xu hướng
    • Pattern
  • Webmaster
  • Trang chủ
  • Chứng khoán
    • Phân tích kỹ thuật
      • Tổng quan phân tích kỹ thuật
      • Sóng Elliott
    • Candlesticks
      • Giới thiệu Candlestics
      • Mẫu hình nến đảo chiều
      • Mẫu hình nến tiếp diễn
    • Indicator
      • Chỉ báo dao động
      • Hỗ trợ và kháng cự
      • Chỉ báo xu hướng
    • Pattern
  • Webmaster
QuyetDoan.Net
Trang chủ Webmaster

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

MrNcToan bởi MrNcToan
25 Tháng Hai, 2019
trong Webmaster
0

In this post I will guide you how to create an Amazon EC2 Instance with CentOS 7. Login SSH by pem key pair in Windows using PuTTy/Bitvise. Connect it via FTPS with FileZilla. Set up root user. Enable password login to EC2 instead of a keypair if you prefer. Then set up VPSSIM and create a wordpress website using VPSSIM.

1. Create EC2 Instance running CentOS

Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Choose Launch Instance to start

Step 1: Choose an Amazon Machine Image (AMI)

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

In Quick Start, you will see some option like:

  • Amazon Linux 2 AMI (HVM), SSD Volume Type
  • Amazon Linux AMI 2018.03.0 (HVM), SSD Volume Type
  • Red Hat Enterprise Linux 7.5 (HVM), SSD Volume Type
  • SUSE Linux Enterprise Server 15 (HVM), SSD Volume Type

Don’t select any of them, because we need a centos to install VPSSIM. You can’t install VPSSIM in Amazon Linux 2 or Red Hat…

So, Click to AWS Marketplace

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

If you only want to set up a WordPress website automatically, you can select WordPress Certified by Bitnami and Automattic. In this post, our purpose is Setup VPSSIM, so we need a fresh Centos. You can find “CentOS” and select one fresh Centos.

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Make sure it’s fresh. Example, if you select “CentOS 7.4 Minimal with Webmin (HVM)”, you can’t install VPSSIM.

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

So, in my opinion, you can select “CentOS 7 (x86_64) – with Updates HVM”

You can read more about this image right here: https://aws.amazon.com/marketplace/pp/B00O7WM7QW

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Just click Continue

Step 2: Choose an Instance Type

In this example, I will select t2 micro. It’s free tier eligible with 750 hours of Linux and Windows t2.micro instances each month for one year. You can readmore here: https://aws.amazon.com/ec2/?ft=n

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

With t2.micro, you have Variable ECUs, 1 vCPUs, 2.5 GHz, Intel Xeon Family, 1 GiB memory, EBS only.

Then, click Next: Configure Instance Details

Step 3: Configure Instance Details

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Step 4: Add Storage

Default Size is 8 GiB. However, in Free tier eligible customers can get up to 30 GB of EBS General Purpose (SSD) or Magnetic storage.

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Step 5: Add Tags

Click to Add Name tag. This is not required. In this example, I will set Name value is QuyetDoan

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Step 6: Configure Security Group

In this example, I will change type to All traffic and Source to Anywhere. You will se a Warning about security setting. But don’t worry, we can also change this rule later.

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Review and Launch

If in Step 4, you select Storage Size over 30 GiB, you will see a notice at this step like below:

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Then you need to change Size to under 30GiB.

If everything’s ok. You will see this:

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Then click Launch

Create a new key pair

After you finish configure the instance. You have to create new key pair or choose an existing one. DON’T select Proceed without a key pair if you don’t know what are you doing.

In this example, my Key pair name is ToanNguyen. Then click Download Key Pair

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

You have to download the private key file (*.pem file) before you can continue. Store it in a secure and accessible location. You will not be able to download the file again after it’s created. If you try to download file again, you will see an error:

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

After you download your pem file and save it in a secure place. Then you can click Launch Instances

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Now you can view your instance:

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

2. Login SSH with key pair

2.1. Prerequisites

Download and install PuTTY or Bitvise

We don’t need both to login SSH, you can select just one that you prefer:

  • You can download PuTTY from from the PuTTY download page: http://www.chiark.greenend.org.uk/~sgtatham/putty/
  • You also can download Bitvise from the Bitvisde download page: https://www.bitvise.com/ssh-client-download

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Check out Public DNS (IPv4) and IPv4 Public IP, we need these info to login SSH

Important Note: When you stop, then restart your Instance. Amazon will release the public IPv4 address and assign a new one. That mean your IPv4 Public IP can be changed. So we have to create an Elastic IP, it’s a a static IPv4 address designed for dynamic cloud computing. An Elastic IP address is associated with your AWS account. So it will not change when you restart your Instance. You can read more about Elastic IP here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html

In next part of this post, I will show you how to create and use an Elastic IP

Default user name for the AMI that you used to launch your instance

  • For Amazon Linux 2 or the Amazon Linux AMI, the user name is ec2-user.
  • For a Centos AMI, the user name is centos.
  • For a Debian AMI, the user name is admin or root.
  • For a Fedora AMI, the user name is ec2-user or fedora.
  • For a RHEL AMI, the user name is ec2-user or root.
  • For a SUSE AMI, the user name is ec2-user or root.
  • For an Ubuntu AMI, the user name is ubuntu.
  • Otherwise, if ec2-user and root don’t work, check with the AMI provider.

In this example, I use Centos AMI, so the user name is centos

2.2. Login with PuTTy

Step 1: Converting Your Private Key Using PuTTYgen

  1. Open PuTTYGen (not PuTTY):

From the Start menu, choose All Programs > PuTTY > PuTTYgen

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

  1. Under Type of key to generate, choose RSA.
    If you’re using an older version of PuTTYgen, choose SSH-2 RSA

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

  1. Choose Load. By default, PuTTYgen displays only files with the extension .ppk. To locate your .pemfile, select the option to display files of all types.

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

  1. Select your .pem file for the key pair that you specified when you launched your instance, and then choose Open. Choose OK to dismiss the confirmation dialog box.
  2. Choose Save private keyto save the key in the format that PuTTY can use. PuTTYgen displays a warning about saving the key without a passphrase. Choose Yes.

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

  1. Save your ppk file

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Step 2: Starting a PuTTY Session

1. Start PuTTY (from the Startmenu, choose All Programs > PuTTY > PuTTY).

2. In the Category pane, choose Session and complete the following fields:

  • Host Name: enter user_name@public_dns_name. 

     

    • User name: centos
    • Public DNS name: ec2-52-221-217-110.ap-southeast-1.compute.amazonaws.com  (check it in instance description)

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

  • Port: 22
  • Conection type: SSH

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

In the Category pane, expand Connection, expand SSH, and then choose Auth. Complete the following:

  • Choose Browse.
  • Select the .ppk file that you generated for your key pair, and then choose Open.
  • (Optional) If you plan to start this session again later, you can save the session information for future use. Choose Sessionin the Category tree, enter a name for the session in Saved Sessions, and then choose Save.
  • Choose Open to start the PuTTY session.
    Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

 

4. If this is the first time you have connected to this instance, PuTTY displays a security alert dialog box that asks whether you trust the host you are connecting to.

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Click Yes.

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

2.3. Login with BitVise

Step 1: Import key

  • Just launch Bitvise then click Client key manager

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

  • In new window, select Import

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

  • You change the option to All Files as below picture then select pem file we already downloaded before. Then click Open

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

  • In new window appear, select Import

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

  • So, now you can see new item Global 1 in Client Key Manager window. That’s fine. It’s mean we already import key succesful.

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Bước 2: Login Bitvise

  • Host: you fill out IPv4 Public IP or Elastic IP
  • Port: 22
  • Username: centos
  • Initial method: publickey
  • Client key: select Global 1 that we already created at previos step.

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

  • Click Login. It’s done. ^-^

3. Elastic IP

Because IPv4 Public IP can be changed. So we have to create an Elastic IP:

Check Elastic IPs in left panel:

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Click to choose Allocate new address

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Click to Allocate

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Close and Assoicate address

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Select Your Instance and Private IP. Then click Asociate

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

So, your Associate address request succeeded

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Now you can also login your SSH with host name: user_name@elastic_ip.

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

4. Enable Root login for EC2 Instance

By default, you have to login your EC2 instance as defaut user (centos for CentOS, ec2-user for Amazon Linux 2 or the Amazon Linux AMI)

If you try to login SSH with root user, you will see an error:

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

There are 2 ways to solve this problem that you can login SSH with root:

  • Enable password login instead of a key pair: With this way, you can login your SSH, FTPS with root and the password you set. 
  • If you dont want enable password login, you can follow instruction below to enable root login when you login with Key Pair.

Step 1: Change to superuser:

sudo -s

Step 2: Edit Athorized keys

I will use Vi to edit file authorized_keys:

vi /root/.ssh/authorized_keys

Press i to change to insert mode. Then delete the lines at the begining of the file until you get to the words ssh-rsa. Press ESC key when you’re done to go back to command mode. Then type :wq and press enter to write the file to disk and quit vi. 

Step 3: Edit sshd_config

We need comment out the line “PermitRootLogin” in sshd_config.

We will use vi editor to edit this file

vi /etc/sshd_config

Press i to change to insert mode, then you can easily edit its content. Find “PermitRootLogin” and comment out.

When you done with editing. Press ESC to back to command mode. Then type :wq and press enter to write the file to disk and quit vi. 

Step 4: Then restart the ssh service

Restart the ssh service in Centos 7+ with this command

/bin/systemctl restart sshd.service

Now you can Login EC2 Instance as root.

5. Connect to Amazon EC2 file directory using Filezilla and SFTP

1. Edit (Preferences) > Settings > Connection > SFTP, Click “Add key file”

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

2. Browse to the location of your .pem file and select it.

3. A message box will appear asking your permission to convert the file into ppk format. Click Yes, then give the file a name and store it somewhere.

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

If the new file is shown in the list of Keyfiles, then continue to the next step. If not, then click “Add keyfile…” and select the converted file.

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

File > Site Manager > Add a new site with the following parameters:

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

  • Host: Your public dns name of ec2 instance, or Elastic IP
  • Protocol: SFTP
  • Logon Type: Normal
  • User: centos or root
  • Password: Password of user. Keep it blank if you have not set passwd for that user yet.

6. Enable password login instead of a key pair 

This section is optional, you can ignore this part if you don’t want to enable password login. With instruction in section 4, 5 we’re already possible to login SSH & FTPS. If you don’t like solution I write in section 4 & 5, you can follow guide in this section, so you can also login SSH & FTPS with root user and password.

Step 1: Login SSH (via Key pair)

You have to login SSH with Key Pair first as my introduction above.

Step 2: Set password for user

sudo -s

passwd root

Step 3: Update the PasswordAuthentication parameter

Edit file /etc/ssh/sshd_config with Vi:

vi /etc/ssh/sshd_config

Press i to change to insert mode. Comment out the line PasswordAuthentication yes. When you done with editing. Press ESC to back to command mode. Then type :wq and press enter to write the file to disk and quit vi. 

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Step 4: Restart the SSH service.

/bin/systemctl restart sshd.service

7. Setup VPSSIM

Before setup VPSSIM, you need a fresh VPS or dedicate server with centos 6.X (64 bit only)  or 7.X.

This instruction can  use to set up VPSSIM for any new VPS/ Server with Centos, not only for Amazon EC2 Instance.

Note: If you don’t like VPSSIM, you can choose any other scipts that you prefer like Hocvps, EasyEngine, Centmin Mod, RunCloud, Webinoly. Make sure it works on your current OS. Example: If you want to use easyengine, coz CentOS or any other Linux Distro is not currently supported, so you need select other image like Ubuntu version 12.04, 14.04, 16.04, 18.04 or Debian 7 & 8.

Command setup VPSSIM

Vietnamese Version

curl http://get.vpssim.vn -o vpssim && sh vpssim

EngLish Version

curl http://get.vpssim.com -o vpssim && sh vpssim

 

5/5 - (1 bình chọn)

Bài viết liên quan

Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

Hướng dẫn tạo VPS chạy CentOS với Amazon EC2 Instance và cài đặt VPSSIM

21 Tháng Ba, 2019
3.4k
Lorem Ipsum là gì? Nguồn gốc và xuất xứ

Lorem Ipsum là gì? Nguồn gốc và xuất xứ

4 Tháng Một, 2019
1.3k
Xóa cache bài viết chia sẻ trên facebook

Xóa cache bài viết chia sẻ trên facebook

2 Tháng Mười Một, 2018
201
Theo dõi
Đăng nhập
Thông báo của
guest
guest
0 Bình luận
Phản hồi nội tuyến
Xem tất cả bình luận

VPS NÊN DÙNG

ĐỌC NHIỀU TRONG TUẦN

  • Lịch sử của phân tích kỹ thuật

    Xu hướng (trend)

    262 Chia sẻ
    Chia sẻ 105 Tweet 66
  • Mẫu hình nến The Inverted Hammer – Búa ngược

    773 Chia sẻ
    Chia sẻ 312 Tweet 192
  • Lorem Ipsum là gì? Nguồn gốc và xuất xứ

    130 Chia sẻ
    Chia sẻ 54 Tweet 32
  • Mẫu hình nến Shooting Star – Sao băng

    280 Chia sẻ
    Chia sẻ 112 Tweet 70
  • Elliott điều chỉnh – Mẫu hình tam giác

    307 Chia sẻ
    Chia sẻ 124 Tweet 76
  • Create Amazon EC2 Instance running CentOS and setup VPSSIM. Step by Step Guide.

    91 Chia sẻ
    Chia sẻ 38 Tweet 22
  • Các dạng của mô hình sóng Elliott điều chỉnh

    257 Chia sẻ
    Chia sẻ 103 Tweet 64
  • Hammer và Hanging Man

    74 Chia sẻ
    Chia sẻ 30 Tweet 19
  • Hướng dẫn tạo VPS chạy CentOS với Amazon EC2 Instance và cài đặt VPSSIM

    358 Chia sẻ
    Chia sẻ 154 Tweet 85
  • Lý thuyết sóng Elliott (Elliott Wave)

    85 Chia sẻ
    Chia sẻ 34 Tweet 21
Mục lục
1. Create EC2 Instance running CentOS
Step 1: Choose an Amazon Machine Image (AMI)
Step 2: Choose an Instance Type
Step 3: Configure Instance Details
Step 4: Add Storage
Step 5: Add Tags
Step 6: Configure Security Group
Review and Launch
Create a new key pair
2. Login SSH with key pair
2.1. Prerequisites
Download and install PuTTY or Bitvise
Default user name for the AMI that you used to launch your instance
2.2. Login with PuTTy
Step 1: Converting Your Private Key Using PuTTYgen
Step 2: Starting a PuTTY Session
2.3. Login with BitVise
3. Elastic IP
4. Enable Root login for EC2 Instance
Step 1: Change to superuser:
Step 2: Edit Athorized keys
Step 3: Edit sshd_config
Step 4: Then restart the ssh service
5. Connect to Amazon EC2 file directory using Filezilla and SFTP
6. Enable password login instead of a key pair
Step 1: Login SSH (via Key pair)
Step 2: Set password for user
Step 3: Update the PasswordAuthentication parameter
Step 4: Restart the SSH service.
7. Setup VPSSIM
Command setup VPSSIM
DMCA.com Protection Status
  • Đăng nhập
  • Chính sách bảo mật
  • Điều khoản sử dụng
  • Site Map

Copyright © 2018 QuyetDoan.Net. All Rights Reserved.

  • Trang chủ
  • Chứng khoán
    • Phân tích kỹ thuật
      • Tổng quan phân tích kỹ thuật
      • Sóng Elliott
    • Candlesticks
      • Giới thiệu Candlestics
      • Mẫu hình nến đảo chiều
      • Mẫu hình nến tiếp diễn
    • Indicator
      • Chỉ báo dao động
      • Hỗ trợ và kháng cự
      • Chỉ báo xu hướng
    • Pattern
  • Webmaster
wpDiscuz