All about SSH connection via AWS and Permissions in LINUX

"At first, SSH might seem like a difficult term, but trust me, after going through this article, I can guarantee that you won't be afraid of SSH anymore. Also, if you're having trouble learning permissions in Linux, there's a good trick in the article.

Permissions

Now, let's start with permissions in Linux. In Linux, you can set permissions on your file to control who can read, write, and execute it. Everything will be under your control.

In the image above, you can see that -rw-rw-r-- is written. These are the permissions assigned. In Linux, we set permissions for three entities: the owner, group, and others. The first three characters are for the owner, the next three are for the group, and the last three are for other users. Now the command by which you can set permissions are :

  1. chmod u+r /example.txt :- to set read permission for owner

  2. chmod g+rw /example.txt :- to set read permission for group

  3. chmod g-w /example.txt :- to remove write permission for group

  4. chmod o+w /example.txt :- to set read permission for others

Now there's another simple and most used way to change the permission and it's by using :

chmod 444 example.txt := to set read permission for user, group, and other users respectively.

Now you can learn which number represent what by the image below you, and then it'll become very easy for you.

Now let's move to our main topic i.e SSH.

SSH

SSH or secure shell let us to connect our machine to a remote server. Now there are other ways to connect so why we use SSH, there are several reasons for using SSH over other options. Two of the many reasons are:

  1. Encryption: SSH encrypts the data exchanged between the client and the server.

  2. Authentication: SSH uses various methods for authenticating users ensuring that only authorized users can access the system.

I'll explain further SSH by taking AWS in consideration. Now first of all you have to launch an EC2 instance on aws and you'll have an key with it. Then open you r terminal in the folder where your key is stored and then when your instance is running then after clicking on connect you will go to SSH screen.

Copy the command written below Example: and then paste it in your terminal and then you'll be connected.

And if you have DNS then you can connect with it directly by following preocess:

  1. You have to open terminal in the folder where your private key is downloaded.

  2. Copy the Public DNS from AWS.

  3. Write command ssh -i "Your_key_name.pem" ubuntu @Your_DNS_name.

  4. Congratulation, now you're connected.

You can do many things after connecting via SCP that depends on you, and you can learn about SCp online. Now thanks for giving your time.