If you ever wondered what is SSH and what is it used for? Secure Shell Hostname system is a method of connecting to the remote server. Regular, Cloud or Local (ie. RaspberryPi) – all the servers need a way to connect. Usually it is used by SSH client connecting to a specific IP on (usually) port 22. There are however continous online threats made by bots scanning unsecured networks. Therefore it is recommended to always change port to something else (you have over 65000+ ports to choose from). It is then harder for bots to discover your main SSH channel. This will always happen regardless, but using this method we reduce number of random host discoveries.

SSH Commands:

Start to use SSH may be as simple as in putting this in the linux terminal and clicking enter:

ssh -p 22 login@192.168.1.100

This way you are connecting to remote ssh where: “-p xx” is port number followed with login and IP address: login@192.168.1.100

To edit ssh configuration file (which is needed for setting up and securing ssh)

sudo vim /etc/ssh/sshd_config

This way you will open a text file with default code paragraph that is located in the path /etc/ssh/sshd_config – to do this we will be using vim text editor.

Edit ssh options found in the file, ie.

allowrootlogin = no

Just dont forget to find another way to log into ssh server before you do this. In other words remember to create a new user with  root priviledges.

There is many different configuration lines you could code for your needs.

In order to enter input mode, type “i”

Save and exit vim – type:

ESC, :, w, q, Enter

If we want to restart the SSH service to load in configuration files:

service ssh restart

To check open SSH connections in old good ps (process list):

ps -aux | grep ssh