SSH Protocol | Complete Process, Attack, and Security. Everything you need to know
Secure Shell (SSH) runs on port number 22 and used for the purpose of secure data communication over an unsecured or less secure network. With SSH, Remote code execution became easy with SSH. Running on the top of TCP/IP for securing the data over the network makes it a transport layer protocol. But when used for the remote login purpose, we call it an application layer protocol. Secure socket sell is another name to this network protocol introduced in the year 1995.
SSH uses a client-server architecture. Consists of multiple utilities that work together to help secure communication by using encryption and authentication. Hence, we prefer SSH over services like Telnet and FTP.
- Symmetric key cryptography: Using the same secret key to encrypt and decrypt anything. For example when a folder named xyz is locked using a password in Pendrive of a person named A. Giving some sensitive information to B through Pendrive, when B unlocks the folder using that same password only.
- Public Key cryptography Involves two different keys (Public key & private key) for both purposes. For example, a chairperson of a company ask employees to make a document. The employees know a public key and use that to encrypt and send it to their boss. Now to decrypt the document so that he can open it, He uses his own private key.
The SSH Schema
The SSH Schema consists of following components
- Client: Like any other service utilizing the request-response model, a client needs to be there to make requests like login, create files or show directories, etc.
- Server: ‘It’s like a ball to that bat named client’. So the client interacts with the server through requests and responses to those requests. The server takes requests and acts accordingly if authenticated successfully.
- Keys: The component of security and authentication here managed by keys. So when a client establishes a connection, authentication of the user & the machine being used takes place. The user public key & host public key enables the server to identify the user & host machine. After establishment, the server public key encrypts the session created and the session private key protects the communication during that session.
Working of SSH
The communication uses TCP port 22. The listening process for coming connections takes place on port 22 of the server while the client machine uses the same port number to send packets.
- TCP Handshake: The first step involves the TCP handshake to establish a connection and verify the user credentials. So whenever the TCP initialization packet gets positive acknowledgement (negative acknowledgement means that the server don’t recognize the client or vice versa)
- The next step requires both the client and server to agree upon the policies and algorithms supported during the whole process for tunnelling.
- If both agree over the policies and supported algorithms match, the generation of the public key takes place. Both client and server use this public key at their end.
- Few examples of the algorithm are AES(Advanced Encryption Standard), SHA(Secure Hash Algorithm), RSA(Rivest Shamir Adleman), DSA(Digital Signature Algorithm)
- Now to interact with that public key in order to decrypt the data packet, a new private key generation takes place.
- Along with private and public key, one more key involved is the secret key which is used with private or public keys to encrypt or decrypt the message.
- Now the user needs to enter the credentials to verify the identity and interact with the server in a private session. (Nowadays, we use SSH key pairing method. Will explain this any other blog someday)
Walkthrough Example & Commands:
Steps: Connecting via SSH through Powershell or terminal
- To connect with a remote server you need two things only.
- IP Address of that server
- Username for that server
Note: If the login is setup using a password, you need a password and if using keys, then via that key file. Also if the connection is using the default port at the listener, you need nothing else. But if the ssh listener is using any other port number like 29302 then you need that.
- Suppose the IP address of that server we want to connect is 192.168.1.23 and the user name is admin1233453
- Just go to the terminal or PowerShell l and type this:
ssh firstname.lastname@example.org (For default) ssh –p 29302 email@example.com (for custom port)
- Now type your password and press enter.
- You are in. You can use Linux commands like ls, cd, etc.
Steps: Connecting via SSH through PuTTY client. Download here
- Install it on your OS.
- Run PuTTY client and enter the IP Address and port (If custom)
- In the prompt, enter your username and password to sign in.
- Use Linux commands to do your work.
Attacks and Security:
- SSH brute force attack
In this type of attack the attacker tries to brute force SSH servers to get logged in.
- Port forwarding attack
This attack enables the attacker to get inside of the restricted hosts. To understand this, let’s take the example of a school or college network. So suppose your college has an internal network plus it is protected through the firewall for internet-related transactions. Now you are also connected to the internet but being an outside network packet, you are not able to enter the firewall. Now suppose if you can use the same firewall`s SSH service for the purpose of interaction with the internal network to compromise that. It sounds shocking but it is possible with port forwarding.
- With keys
Things have changed to a great extent. But the careless or lazy attitude of employees sharing the keys to save effort creates a huge risk.
- Never use the default port for SSH
- Use firewalls and filter the SSH
- Never use default credentials
- Rate limiting of an attempt to login helps a lot
- Update regularly.
Learn about DHCP Protocol in our computer network series here.
39 thoughts on “SSH Protocol | Complete Process, Attack, and Security. Everything you need to know”
coursework project https://brainycoursework.com/
coursework online https://brainycoursework.com/
custom coursework writing service https://courseworkninja.com/
custom coursework writing service https://courseworkninja.com/
coursework writer https://writingacoursework.com/
do my coursework online https://writingacoursework.com/
coursework writing services https://mycourseworkhelp.net/
coursework writing service uk https://mycourseworkhelp.net/
coursework help university https://courseworkdownloads.com/
custom coursework https://courseworkinfotest.com/
coursework papers https://coursework-expert.com/
buy coursework online https://coursework-expert.com/
coursework samples https://teachingcoursework.com/
coursework writing help https://teachingcoursework.com/
coursework on a resume https://buycoursework.org/
creative writing coursework https://buycoursework.org/
coursework writing services https://courseworkdomau.com/
coursework questions https://courseworkdomau.com/
dating relationships https://freewebdating.net/
the dating game https://jewish-dating-online.net/
hinge dating site https://jewish-dating-online.net/
plenty of fish https://sexanddatingonline.com/
online dating site crossword https://sexanddatingonline.com/
senior dating https://onlinedatingsurvey.com/
best free dating sites https://onlinedatingsuccessguide.com/
free dating sites online https://onlinedatingsuccessguide.com/
dating seiten in schweiz https://onlinedatinghunks.com/
positive singles https://onlinedatinghunks.com/
best site for online dating https://datingwebsiteshopper.com/
dating site online https://datingwebsiteshopper.com/
free adult personal ads https://allaboutdatingsites.com/
meet= dating dating https://allaboutdatingsites.com/
flirt dating site https://freedatinglive.com/
dateing site https://freedatinglive.com/
free online https://freewebdating.net/
online dating app https://freewebdating.net/