Jak povolit SSH na Almalinuxu

SSH je primární metoda vzdáleného přístupu a správy zapnutá Linuxové systémy. SSH je služba klient-server poskytující zabezpečená a šifrovaná připojení prostřednictvím síťového připojení. Po. instalace AlmaLinux nebo migrace z CentOS do AlmaLinux, bude to pravděpodobně jedna z prvních věcí, které chcete nakonfigurovat.

V této příručce projdeme postupné pokyny k instalaci a konfiguraci SSH AlmaLinux To vám pomůže, zda se chcete pouze připojit ke vzdáleným systémům přes SSH, nebo chcete, aby váš vlastní systém přijímal také příchozí připojení.

V tomto tutoriálu se naučíte :

  • Jak nainstalovat SSH
  • Jak spustit a zastavit službu SSH
  • Jak povolit SSH prostřednictvím systémového brány firewall

SSH server enabled and running on AlmaLinux

Server SSH byl povolen a spuštěn na AlmaLinux

 

 

 

Požadavky na software a konvence příkazového řádku systému Linux
CategoryRequirements, Conventions or Software Version Used
SystemAlmaLinux
SoftwareOpenSSH
OtherPrivileged access to your Linux system as root or via the sudo command.
Conventions# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

How to enable SSH on AlmaLinux

Follow the step by step instructions below to get SSH installed on your system and use it to initiate remote connections or accept incoming connections.

    1. Install the appropriate OpenSSH package for your system. The openssh-server package will need installed if you’d like your computer to accept incoming SSH connections. Otherwise, if you’d just like to initiate outgoing connections with the ssh command, then you can install the openssh-clients package. Of course, you may also install both.
      # dnf install openssh-server openssh-clients
      
    2. The SSH service can be controlled through systemd. Use the following systemctl commands to configure and control the service.To start or stop the SSH server:
      # systemctl start sshd
      AND
      # systemctl stop sshd
      


      To enable (make SSH start automatically at system boot), or disable the SSH server:

      # systemctl enable sshd
      AND
      # systemctl disable sshd
      
    3. Check whether the SSH server is running by using the systemctl status command.
      # systemctl status sshd
      

The sshd status indicates that the service is currently running

Stav sshd označuje, že služba je aktuálně spuštěna

 

 

  1. Abyste mohli přijímat příchozí připojení, musíte povolit službu prostřednictvím brány firewalld provedením následujících příkazů.
    # firewall-cmd --zone = public --permanent --add-service = ssh # firewall-cmd --reload

That’s all there is to it. For an in-depth look at additional configuration of OpenSSH, check out our dedicated guide for co nejlépe využít OpenSSH.

Closing Thoughts

In this guide, we saw how to enable SSH on AlmaLinux. This included installing the OpenSSH client and server packages, and configuring our system to accept incoming connections. SSH is an essential protocol for most Linux systems, as it allows you to open remote terminals to any number of systems, or to manage your own system from over the internet.

Source: https://linuxconfig.org/how-to-enable-ssh-on-almalinux