What is SSH?
SSH definition
SSH, which stands for Secure Shell or Secure Socket Shell, is a network protocol that allows you to securely connect to remote devices over an unsecure network. The SSH protocol runs on a client-server model, in which the SSH client is the device that initiates the connection, and the SSH server is the remote device that accepts the request to connect and where all the actions are executed.
SSH allows you to carry out various commands, such as controlling remote servers, systems, and applications or transferring files. The protocol uses symmetric cryptography to encrypt traffic – a feature that allows for secure connections over various networks.
How does SSH work?
For the SSH protocol to work, you first need to establish a connection between your client device and a remote server device. This process includes a remote server sharing its cryptographic key with your client device and setting up encryption parameters to secure that connection.
The first time you connect to a remote device, your local device stores the remote computer’s public key in its known_hosts file. The saved public key will allow you to connect to the server directly in the future. Afterward, you’ll be prompted to secure your connection further by creating your password and enabling user authentication.
So far, we have learned that SSH enables local and remote computers to recognize each other using public key cryptography. During the connection process, your local device checks the remote server’s public key against the one stored in the known_hosts file. Once computers recognize each other, it’s time for you to prove your identity with a user ID and a password.
From this moment on, the remote device will use its private key to create digital signatures and decrypt challenges sent by the client device, proving its identity and the legitimacy of the connection.
What are the SSH commands?
The connection and commands on the remote server are typically invoked through a command line or executed as part of the script. For instance, the most basic command that would technically allow you to connect to the server is:
However, in a real-life setting, your user ID for the remote device will likely be different from the one you use to unlock your client device. If that’s the case, you should issue the command specifying the remote server ID:
These are only the simplest commands that would open the door to the remote computer. You can use more complex commands to ask the remote machine to allow you to access specific resources or transfer data.
What does SSH do?
SSH establishes a connection between your local device and a faraway computer so you can interact with the remote machine as if you’re connected to the same network. Once you connect to the remote device, SSH allows you to:
- Access and manage remote computer’s infrastructure and servers.
- Transfer files securely.
- Execute commands.
- Access a remote computer’s cloud services without revealing your local computer ports online.
SSH uses public key encryption to ensure that data exchange between the devices is secure. The algorithm scrambles data when it’s transferred from one device to another, so if anyone manages to intercept it in transit, they’d only see random bits of data.
How is SSH implemented?
Currently, there are dozens of ways to implement SSH for various platforms, but the most popular method remains using the open-source OpenSSH protocol. It supports the three most widely used operating systems: Linux, macOS, and Windows.
Typically, SSH comes pre-integrated within Linux and macOS. You only need to open the Terminal application and enter your SSH commands there. Meanwhile, the protocol has to be manually enabled or sometimes even installed on Windows machines.
SSH tunneling
SSH tunneling, also called SSH port forwarding, is a way of sending data packets from one device to another using a secure and encrypted path. Direct connections to a remote machine can sometimes be unsecure or blocked by firewalls. When redirecting network traffic through a manually chosen secure port, you can avoid blockage and unauthorized interceptions.
The inner workings of port forwarding include wrapping up data packets with additional information to change their endpoint. You can make SSH tunneling work on both local and remote networks. In fact, you can even use port forwarding to create a secure data tunnel between two remote devices that you manage through your local device.
SSH security
SSH is considered a secure method for managing remote systems and transferring data, provided it’s properly configured. The protocol’s robust security comes from its use of encryption and public key authentication to secure SSH connection and data in transit.
Security issues arise whenever enterprises fail to manage SSH authentication keys properly. A mess in SSH files can open the doors for hackers to intercept both remote and local networks.
The main issue is that SSH keys from various connections tend to accumulate on the client’s device over time. If organizations lose control over who has access to particular resources, it becomes hard to recognize unwelcome intruders in the network.
It’s probably no surprise that hackers have also discovered the potential of SSH connections. SSH tunnels can pass through corporate firewalls – a dream come true for hackers who manage to steal the SSH authentication keys. Cybercriminals have also used SSH connections to extract sensitive data, gain root server access, and open backdoors to companies' networks.
Like what you’re reading?
Get the latest stories and announcements from NordVPN
We won’t spam and you will always have the choice to unsubscribe