Get started - it's free!
Login
WireGuard is a registered trademark of Jason A. Donenfeld.
© 2025 Tailscale Inc. All rights reserved. Tailscale is a registered trademark of Tailscale Inc.
Go back

What is Secure Shell (SSH)?

Discover the importance of SSH ports, including what the are, how they work, who in your organization should be using them, and best practices for securing your network infrastructure.

What is Secure Shell (SSH)?

SSH, or Secure Shell, is a cryptographic network protocol that enables secure communication between two computers over an unsecured network. Developed in 1995, SSH replaced less secure protocols such as Telnet and FTP. It provides features like strong encryption, password authentication, and public key authentication.

By encrypting the data transmitted between the client and server, SSH ensures that sensitive information remains protected from eavesdropping and tampering.

Overview: SSH Components

Secure shell is composed of three main components that work together to ensure secure communication between the client and the remote server:

  • The transport layer protocol
  • The user authentication protocol
  • The connection protocol

The transport layer is responsible for establishing a secure connection between the SSH client and server, ensuring data integrity and confidentiality.

The user authentication protocol handles user authentication, verifying the identity of the user attempting to access the remote server.

The connection protocol manages the encrypted tunneling, facilitating secure communication between the client and server.

SSH supports multiple authentication methods, including password authentication, public key authentication, and multifactor authentication, providing flexibility and enhanced security for users.

This provides flexibility and enhanced security for users. This robust framework makes SSH an essential tool for secure remote access and management.

What is the SSH Port?

The SSH port is a specific network port used by the secure shell protocol to facilitate secure connections. Within the client-server model, the SSH client initiates a request to connect to the server on the designated port, typically port 22 by default. The server listens on this port, awaiting incoming requests, and establishes a secure encrypted session once authentication is successful. This mechanism ensures safe communication over unsecured networks.

SSH versus Port 22

From a high level, SSH is the technology that powers secure communication, while Port 22 is the standard channel through which SSH traffic flows. SSH (Secure Shell) and Port 22 are closely related concepts.

This table shows some of the key similarities and differences between SSH port and Port 22:

Aspect SSH (Secure Shell) Port 22
Definition A cryptographic protocol for secure communication. A network port used for SSH traffic.
Primary Purpose To securely connect to remote systems and transfer data. To facilitate SSH connections by serving as the default port.
Function Provides secure remote login, file transfers, and command execution. Provides the entry point for SSH communication.
Protocol or Port? A protocol (set of rules for secure communication). A network port (physical "door" for traffic).
Security Provides encryption, authentication, and data integrity. Not inherently secure on its own—relies on SSH for security.
Default Port Not a port itself—it's the protocol used for secure connections. Default port for SSH communication (port 22).
Customizability Can be configured to use different ports. Can be changed to another port for added security.
Usage Used for encrypted communication (remote login, file transfers, etc.). Used to establish an SSH connection.
Typical Port Number Does not have a specific number—it's a protocol. Port 22 (by default).

Who uses secure shell (SSH)?

Secure shell is beneficial for jobs that involve managing secure connections, network configuration, and ensuring secure communication across different platforms and protocols.

While job descriptions vary between organizations, here are some roles that would typically benefit from using SSH:

  • System Administrator: Use SSH to securely manage remote servers, configure network components, and execute commands without physical access to the machines. SSH is essential for remote server maintenance, troubleshooting, and system updates.
  • Network Engineer: Use secure shell to configure network devices (e.g., routers, switches) securely. SSH also allows them to create secure tunnels for managing other network protocols, making it an invaluable tool for remote network management.
  • DevOps Engineer: Rely on SSH to securely deploy code and manage infrastructure across multiple systems. SSH is vital for automating tasks, securely accessing cloud environments, and managing containers or virtual machines.
  • Cloud Engineer: Use SSH to securely manage cloud resources, including servers and databases. The protocol lets them configure cloud infrastructure securely while ensuring same remote access to cloud environments.
  • Site Reliability Engineer: Use SSH tunnels to securely access and manage services running on remote machines.

Beyond its core functionality, secure shell protocols are a great tool for any job requiring secure remote communication server management or networking tasks where sensitive data is involved.

Benefits of SSH Ports

SSH ports serve as gateways for secure access. As explained previously in this article, TCP port 22 is commonly used for secure file transfer and remote access through the SSH protocol.

Here are some reasons why SSH ports support secure networking:

  • Remote Administration: System administrators rely on SSH ports for secure server management and command execution.
  • Data Protection: SSH ports ensure encrypted data communication, safeguarding sensitive information from interception.
  • Flexibility: SSH ports can be customized to enhance security by reducing exposure to automated attacks on default port 22.

Drawbacks of Port (22)

Using the default SSH port (22) is convenient, but it comes with security risks. Namely, the ssh command can be used to change the default port number for enhanced security. Attackers often target this port for brute-force attacks.

You can mitigate the risk by changing the SSH port to a non-standard number. This reduces the visibility of your server to malicious actors.

Best Practices: Securing Your SSH Port

We have an in depth guide to best practices for SSH in this article, but here is an overview:

  • Enable Strong Authentication: Use SSH keys instead of passwords, combined with two-factor authentication (2FA). Understanding and using ssh commands is crucial for managing security and configuring SSH settings effectively.
  • Limit Access: Restrict SSH access to specific IP addresses using firewall rules.
  • Implement SSH Bastion Hosts: Funnel all SSH traffic through a single, secure gateway for enhanced monitoring and control.
  • Monitor SSH Activity: Regularly audit logs to detect and respond to suspicious activities.
  • Use Fail2Ban or Similar Tools: Block IP addresses that exhibit malicious behavior, such as repeated failed login attempts.

SSH Security Features

SSH offers several key security features that make it a preferred choice for secure remote access:

  • Encryption: All data transmitted between the client and server is encrypted, ensuring that it is protected from tampering and eavesdropping.
  • Authentication: SSH provides strong authentication mechanisms, such as password authentication and public key authentication, to verify the identity of users and ensure that only authorized individuals can access the remote server.
  • Integrity: The protocol ensures the integrity of the data transmitted between the client and server, preventing any tampering or manipulation during transmission.
  • Port Forwarding: SSH allows for secure port forwarding, enabling users to access remote services securely by redirecting network traffic through an encrypted SSH connection.
  • Secure File Transfer: SSH includes a secure file transfer protocol (SFTP) for transferring files between the client and server, ensuring that file transfers are protected from unauthorized access.

By leveraging these security features, SSH provides a comprehensive solution for secure remote access and management, making it an indispensable tool for system administrators and IT professionals.

SSH Port Forwarding

SSH port forwarding, also known as tunneling, redirects network traffic securely through an SSH connection. This technique can be categorized into:

  • Local Port Forwarding: Routes client-side application traffic to a remote server.
  • Remote Port Forwarding: Allows remote services to be accessed through the client.
  • Dynamic Port Forwarding: Provides flexible routing for multiple applications using a single SSH connection.

These methods enhance security for distributed systems and help bypass network restrictions.

How Tailscale SSH can help

Tailscale SSH doesn't require additional hardware, complicated firewalls and using tags, it now lets you isolate the identity of the devices you use in development and production environments.

[Watch] What is Tailscale SSH? | Tailscale Explained

Learn more about Tailscale SSH or download Tailscale for free to get started today.

FAQs

  • SSH access to infrastructure—ensure all SSH traffic is routed over the tailnet.
  • Reduce usage of other tools—consolidate tooling for managing SSH access.
  • Meet compliance needs—meet workforce regulatory and compliance requirements for SSH.

Click here to access the complete doc.

Prerequisites

Tailscale SSH’s server component is only available on:

You can connect from any device running Tailscale, regardless of platform. Tailscale SSH's server component requires Tailscale v1.24 or later.

To enable Tailscale SSH, you must:

  • Advertise Tailscale SSH from the destination to which you want to connect.
  • Ensure an ACL exists that allows the source to connect to the destination on port 22.
    • This is not necessary if you haven’t modified the ACLs in your account, as the default ACL allows all traffic.
    • This may require modifying the tailnet policy file to include SSH. You need to be an Admin or Network admin in order to modify the tailnet policy file.
  • Ensure an ACL exists that allows the source to SSH to the destination machine using Tailscale SSH.
    • This is not necessary if you haven’t modified the ACLs in your account, as the SSH access rules in the default ACL allows all traffic.
    • This will require modifying the tailnet policy file to include SSH policies. You need to be an Admin or Network admin in order to modify the tailnet policy file.

Try Tailscale for free

Schedule a demo
Contact sales
cta phone
mercury
instacrt
Retool
duolingo
Hugging Face