How to Setup ProFTPD on EC2

Introduction:

Basically, ProFTPD is method to transfer files online.If you open up your browser and want to visit some site and type URL of your required site you can see your browser only uses one protocol i.e HTTP.There are many other protocols that make up the internet.Different Protocols used for different purposes.
TCP (Transmission Control Protocol) and UDP(User Datagram Protocol) both are used for sending bits of data, known as packets, over the internet.For more detail about Protocols Click here to visit my blog.

ProFTPD is a popular FTP server. FTP(File Transefer Protocol) is a method to upload files to a server.
FTP is a application layer protocol.It’s also occasionally used as a way to share files. One person may upload a file to an FTP server, then share a link to it with another person.FTP server offers access to a directory, with sub-directories. Users connect to these servers with an FTP client, a piece of software that lets you download files from the server, as well as upload files to it.
Well, it essentially looks like the other files on your computer. There’s a hierarchical folder structure, which you can explore in a similar fashion to Windows Explorer or Finder.

Installation

First thing you open a terminal and ssh to your EC2 instance and update it:

sudo apt update

To install Proftpd type this command:

sudo apt install -y proftpd

When you enter this command this window will come up on your screen:

Screenshot from 2018-07-23 12-30-12

Read More »

Protocols

Introduction of Protocol

The word Protocol comes from the Greek “protocollon”, meaning a leaf of paper glued to a manuscript volume that describes the contents.In information technology, a protocol is the special set of rules that end points in a telecommunication connection use when they communicate. Protocols specify interactions between the communicating entities. If you open up your browser and want to visit some site and type URL of your required site you can see your browser only uses one protocol i.e HTTP(Hyper Text Transfer Protocol).There are many other protocols that make up the internet.Different Protocols used for different purposes.

Types of Protocols

There are two models i.e OSI model and TCP/IP model, these models are divided into different layers and protocols are also divided layer to layer depending upon the working and purpose of protocols accordingly to layer.

tcp.jpeg

Read More »

Docker

Introduction

Docker is a tool which provide easiest way to create,deploy, and run application by using containers.Containers allow a developer to upgrade an application with all of the parts need such as libraries and other dependencies and output as one package.Docker benefits for both developer and system administrator.For developer, they have to focus only on writing the code without worrying about the system. Docker gives flexibility and potentially reduces the number of systems needed because of its small footprint and lower overhead.

Container  and Virtual Machine

docker.jpg

Container is so light weighted as compare to Virtual Machine’s.Virtual machine is complete operating system they have its own memory storage, API and libraries and everything. Container is bit like virtual machine but rather then creating an whole virtual operating system, docker allow to use the same linux kernel as the system that they’re running on and only requires applications be shipped with things not already running on the host machine. This gives a significant performance boost and reduces the size of the application.

Image and container

Using the same concept of object oriented programming, the difference between docker image and container is the same as the difference between the class and object. object is the runtime instance of that class.Image is a template and Container is also the some type of instance of that image.

Read More »

Vector Grapher

Vector Grapher was our group project of CS-103 course. Idea was proposed by my colleague Ahmed Waheed. Group project is considered as a  foremost in any course . That’s why we decided to do something new and unique to check our skills that we had learned in computer programming course, in a better way and  output should be a productive project  not only a project.This is our first ever project in university so we were so excited, passionate and zealous about our project and little bit confused.But at that time we didn’t  know what to do ?

Then we saw this in Calculus-II Book:

Screenshot from 2018-07-17 13-16-22

Helix seen in above screen shot was our motivation. We decided to do this as group project in CS-103.We meet our Calculus Instructor, Professor Dr. M. Tariq Rahim, told him about our idea. Dr. M. Tariq Rahim said that’s a brilliant idea. This is never done by any student in Fast university yet.But this is not a bit difficult job, you can do this very easily by working hard. If you need any help, I will be there for you.  We were motivated and we finalized to take Vector grapher as a semester project.

First most Difficult part was accomplished,Second task i.e making a proposal to submit to our course instructor of Computer Programming, Assistant Professor M. Tehseen Khan. Making a proposal was not as simple as piece of cake we had a call of almost half hour for writing proposal at midnight to submit , because we were not able to submit proposal in time.

Read More »

Establish EC2 using Python Scripts

We will take a look at using Python Scripts to interact with infrastructure provided by Amazon Web Services(AWS).
In this tutorial, We are considering only Python scripting for EC2.

First thing, You have to check python is installed in your machine by typing simple command:

which python

That will show you the path of python executable. If python is not installed in your machine first download it from this site: https://www.python.org/downloads/

After this check the version of python by typing:

python -V

We are using python 2.7.12 and you can use python 2.6 or higher.

Next thing you have to check pip is intall in your machine by typing command:

 which pip

That will show you the path of pip executable.If pip is not installed in your machine first download it from this site: https://pip.pypa.io/en/stable/installing/

Your version of pip should be 9.0.1 or newer.Check your version of pip by typing :

pip -V

Install boto3  and AWS CLI

Now basic installation is completed. Now install the library of python which is used to interact with AWS on by using this command

pip install awscli boto3 -U --ignore-installed six

Now login to your AWS account and select IAM.

Screenshot from 2018-07-16 13-08-51

This window will come on your screen.Read More »

Monit

Monit is a tool to monitor daemons process like apache web server,Mysql database etc.Monit check the service automatically after some time(that you set in configuration)If some problem occurs in running the service Monit automatically restart the service. And then if error occurs in restarting the service monit will solve the error and then run the service agian. Monit try to debug all the errors and if then some error come which is not solved by the monit then monit will alert you by sending a notification on a mail and send you whole information about what Monit have done to solve the problem.

How to set up Monit on EC2

Now we consider a usecase of apache web server that we are deploying on a machine.
The first thing you have to do is to install apache by typing this command.

sudo apt update && upgrade
sudo apt install apache2

Now install monit by typing this command.

sudo apt install monit

Read More »

SSH

Introduction

SSH is a secure protocol used as the primary means of connecting to another Linux machine remotely. It provides you a command line interface where you can type your command that you want to run on anonther machine. After connection, all command you type in your local terminal are sent to remotely connected machine and executed there.SSH stand for Secure Shell.

Working

SSH connection is working on client-server model. This means that for an SSH connection to be established, the user’s computer must have SSH client and the remote machine must have SSH server. This software listen for a connection on specified network port and authenticate connection request, and spawns the appropriate environment if the user provides the correct credentials.

SSH Authentication

Clinet generally authenticate using SSH keys which are very secure. Password logins are encrypted and easy to understand for new user.SSH keys are a matching set of cryptographic keys which can be used for authentication. Each set contains a public and a private key. The public key can be shared freely without concern, while the private key must be vigilantly guarded and never exposed to anyone.

To authenticate using SSH keys, a user must have an SSH key pair on their local computer. On the remote server, the public key must be copied to a file within the user’s home directory at ~/.ssh/authorized_keys. This file contains a list of public keys, one-per-line, that are authorized to log into this account.

When a client connects to the host, wishing to use SSH key authentication, it will inform the server of this intent and will tell the server which public key to use. The server then check its authorized_keys file for the public key, generate a random string and encrypts it using the public key. This encrypted message can only be decrypted with the associated private key. The server will send this encrypted message to the client to test whether they actually have the associated private key.

Upon receipt of this message, the client will decrypt it using the private key and combine the random string that is revealed with a previously negotiated session ID. It then generates an MD5 hash of this value and transmits it back to the server. The server already had the original message and the session ID, so it can compare an MD5 hash generated by those values and determine that the client must have the private key.

Installation

To install SSH o your machine simple open Terminal on your machine and type a command:

sudo apt install openssh-client

And then open the Terminal  on the machine you want to connect to your machine  and install openssh-server :

sudo apt install openssh-server

Read More »