diff --git a/source/clear-linux/reference/bundles/openssh-server.rst b/source/clear-linux/reference/bundles/openssh-server.rst index 99e6d80d..0d63a725 100644 --- a/source/clear-linux/reference/bundles/openssh-server.rst +++ b/source/clear-linux/reference/bundles/openssh-server.rst @@ -8,6 +8,46 @@ Remote users require a SSH service to be able to use an encrypted login shell. The first time OpenSSH starts, it generates the server SSH keys needed for the service. +|CL| enables the `sshd.socket` unit, which will listen on port 22 by default and +start the openssh service as required. + +Change Default Port +=================== +In order to change the default listen port for the OpenSSH\* service, perform +the following steps: + +#. Edit the sshd.socket unit file, provide the `ListenStream` option in the + `[Socket]` section with no value in order to remove the |CL| default port + value, then provide the `ListenStream` option again with the new default + port to listen. In this example, we change `ListenStream` to + listen on port 4200 instead of the |CL| default: + + .. code-block:: console + + # systemctl edit sshd.socket + +#. Verify your changes: + + .. code-block:: console + + # cat /etc/systemd/system/sshd.socket.d/override.conf + [Socket] + ListenStream= + ListenStream=4200 + +#. Reload the systemd daemon configurations: + + .. code-block:: console + + # systemctl daemon-reload + +#. Restart the sshd.socket unit: + + .. code-block:: console + + # systemctl restart sshd.socket + + SFTP ====