Introduction

The administration of a server only makes sense via SSH and could also be activated directly during installation. If this was not done, we will briefly explain here how to do it. Even a newly created jail does not have SSH activated by default and requires the same steps.

Prerequisites

SSH is part of the base system and is activated with service sshd enable and started with service sshd start. That's it :)

Ok, bonus content:

Access via SSH key

Logging into a system with a password can be very tedious in the same network and can be simplified considerably by storing a ‘key’ at the destination. The following steps are necessary for this:

  • On the visitor's system:
    • ssh-keygen generates a so-called key pair. A private key (id_rsa) and a public key (id_rsa.pub). The private part must be kept confidential and is as valuable as a password. To be on the safe side, this can also be protected with a password. This can also be done subsequently with ssh-keygen -p -f ~/.ssh/id_rsa. The two files are saved in /home/USERNAME/.ssh/
    • The public part of the key is now copied to the target system with ssh-copy-id -i ~/.ssh/id_rsa.pub USERNAME@HOSTNAME and automatically marked as ‘authorised’.
    • A connection is then established with ssh USERNAME@HOSTNAME without a new password request (or only that of the private key. Your decision)

Voilá