Maximizing Efficiency: Socket-Based SSH Activation in Ubuntu 22.10 and above
Sneh Chauhan
Posted on October 18, 2023
Introduction
In the dynamic landscape of Ubuntu, innovation is the driving force that propels it forward. With the release of Ubuntu 22.10, a seismic shift has occurred in how we interact with one of the most fundamental services: SSH. Meet socket-based activation, a game-changer in how we handle remote connections.
This paradigm shift introduces a more resource-efficient approach to launching SSH services, promising a more judicious allocation of system resources. In this blog post, we embark on a journey through this transformative feature, exploring the intricacies of socket-based activation for SSH in Ubuntu 22.10 and beyond.
What is Socket-Based Activation?
Socket-based activation is a method used to manage services on a Linux system, including SSH. Traditionally, services like SSH were started directly by systemd. However, with Socket-based activation, the service won't start until there is an incoming request. This approach introduces a few key benefits :
Resource Efficiency: System resources like memory and CPU are used judiciously as the SSH service is started only when a connection is requested.
Faster Bootups: As SSH is only initiated when a connection is requested, it eases the burden on systemd when starting services during bootup.
Traditional SSH vs Socket-Based SSH
Traditional SSH involves starting the SSH service (ssh.service ) directly during system boot by systemd even when there is no incoming connection request. In contrast, Socket-based SSH (ssh.socket ) waits till a connection request is made and then it invokes the SSH service.
Inspecting the "ssh.service" unit in Traditional and Socket-Based SSH using systemctl gives us more information about the resource utilization :
As it can be seen in Traditional SSH, the ssh.service unit is "enabled" on startup and the memory usage is 14.6 megabytes.
On the other hand, in Socket-Based SSH, the ssh.service unit is "disabled" on startup and it is triggered by "ssh.socket" upon new connection request. The memory usage here is just 2.3 megabytes which is way less than Traditional SSH.
Which Ubuntu versions adopt this change?
Starting with Ubuntu 22.10 (Kinetic Kudu), this change in SSH activation method continues in subsequent versions 23.04 (Lunar Lobster) and 23.10 (Mantic Minotaur) which is the latest version at the time of writing this article.
How are Ubuntu users reacting to the change?
The transition to socket-based activation for SSH in Ubuntu 22.10 and above has brought about a mixed response from the user community. While many users appreciate the potential benefits in terms of efficiency and resource management, some have encountered challenges, particularly related to custom port usage and the desire to revert to the traditional SSH setup.
One notable concern revolves around the use of custom ports for SSH connections. With socket-based activation, users have found that configuring SSH to listen on a non-standard port can be more intricate than with the conventional setup. This has led to frustration for those who rely on custom ports for security reasons or due to network configurations.
Additionally, there's a segment of the user base that, for various reasons, prefers or requires the familiarity and predictability of the traditional SSH setup. These users have expressed a desire to revert back to the previous method of managing SSH services.
Conclusion
In summary, Ubuntu's move to socket-based SSH activation offers enhanced efficiency. User feedback, particularly on custom port configurations, is vital for refinement. With continued improvements, this feature is set to be a valuable asset.
Posted on October 18, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.