0% found this document useful (0 votes)
1 views

9_Working_with_Secure_Shell

This document provides an overview of Secure Shell (SSH), a protocol that enables secure remote server communication. It covers the SSH environment, basic commands for server interaction, and the default port number for SSH connections. Additionally, it mentions the ability to create private Git repositories using SSH on the server.

Uploaded by

Aman Ali
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

9_Working_with_Secure_Shell

This document provides an overview of Secure Shell (SSH), a protocol that enables secure remote server communication. It covers the SSH environment, basic commands for server interaction, and the default port number for SSH connections. Additionally, it mentions the ability to create private Git repositories using SSH on the server.

Uploaded by

Aman Ali
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Working with Secure Shell

In this lesson, we will learn how to communicate with our server remotely.

WE'LL COVER THE FOLLOWING

• The SSH Environment


• Basic Commands
• Port Number
• Git Repositories

Secure Shell, popularly known as SSH, is a platform which allows us to


remotely control our server over an internet connection. It is a terminal based
protocol system which is available on macOS, Linux and Windows.

SSH was originally developed because of the security concerns regarding its
predecessor, Telnet. Server communication is now much more secure
because of the data encryption methods used by the SSH protocol. In terms of
functional power, SSH allows us to basically control every aspect of the server
running our website.

The user sends commands SSH transmits these commands to


to the server using SSH the server over an encrypted connection

Now, let’s take a look at how we can set up the SSH terminal on our machine.

The SSH Environment #


SSH comes in-built with Linux and macOS. We can access it using the
terminal. For Windows, there are several SSH clients like PuTTY which allow
us to work with SSH.

Basic Commands #
The most important SSH command is to open a connection to our remote
server. Here is the command we need to run on the terminal:

<user>@<domain name or IP address>

First, we need to define the user , which is the account we want to use. The
next step is to mention the domain name or the IP address of our website. For
example, the root user would open up a connection on our platform this way:

[email protected]

Or we could use the IP address like this:

[email protected]

We must then put in our password to access the server. This connection is
secured by SSH using hashing, symmetric encryption and asymmetric
encryption. Without getting into details, all we need to know is that this is a
big improvement over Telnet’s security measures.

Below, we’ve listed a few more basic operations that can be performed on the
SSH terminal.

Command Purpose Syntax

Display all the files ls (basic) or ls -a


ls and directories on the (shows hidden files as
server machine. well)

Create a new
mkdir mkdir newDirectory
directory.

Move into the


cd cd anyFolder
specified directory.
touch Create a new file with touch newDoc.txt

a specified format

Delete a file or
directory. Use rm -r
rm to remove all files in rm newDoc.txt
the directory being
deleted

Print the current


pwd directory we are pwd
working in

cp source
Copy files and destination (we can
cp
directories. use several flags
before source )

scp filename
host:path ( host can
Copy files/folders to
scp be the host domain
and from the server.
name or the IP
address)

Move files and


mv mv source dest
directories.

Search for a file in a


given directory. It can find . -name
find
also return multiple file.txt
files.

This list is not exhaustive by any means. For more details, visit Secure Shell’s
official website.

Port Number #
By default, SSH connects to port 22, but we can always choose a different port
if we want. Opting for another port is also useful because hackers will only try
to attack port 22.

To change the port number for SSH, we run the following command:

ssh -p port user@server

Git Repositories #
If Git is installed on our machine as well as the server machine, we can create
private Git repositories using SSH. We simply have to move to the desired
directory on the server and run this command:

git init

Now that we’ve understood SSH, we’ll move on to the File Transfer Protocol
and learn how it is incorporated with SSH.

You might also like