Create an SSH key under Linux and macOS: Here's how 1st step: 2nd step: 3rd step: 4th step: 5th step: How to create an SSH key on Windows 1st step: 2nd step: 3rd step: 4th step: 5th step: 6th step: What to do with the SSH keys
SSH, short for “Secure Shell”, is a practical matter: Using a terminal - or in Windows systems with the help of the small PuTTY tool - you can conveniently manage another computer remotely via SSH via the command line. This is always practical when Unix-based systems - such as a media center PC, a craft computer, a server or web server or a NAS - are involved. Thanks to SSH, the systems do not need a user interface, a connected keyboard, mouse or screen: SSH takes care of the terminal control remotely, conveniently from the laptop or PC. In order for this to work smoothly and securely, an SSH key should be set up for what is known as public key authentication: This consists of a key pair in the form of a public and a private key and ensures a secure login.
Create an SSH key under Linux and macOS: Here's how
In order to create an SSH key under Unix systems such as Linux or macOS, the so-called terminal is important. This is the command line within the graphical user interface of the system. If you use Linux without an interface, you can also use the respective shell - there is no difference here.
How to create an SSH key on Windows
What to do with the SSH keys
Once the key pairs have been created, nothing stands in the way of their use. Since the creation took place on the "control computer", i.e. the laptop or PC, the public key still has to be copied to the server. First you have to log in to the server and then store the key there. The command required for this in the terminal is:
ssh-copy-id -i ~ / path / to / key file user @ server
The paths and users must of course be adapted to your conditions..
You can then contact
ssh -i ~ / path / to / key file user @ server
log on to the server. A password is no longer required in the set setting, since the private and public key match. The command line may complain that the key is not available. In this case you have to move the file with the private key to the hidden user subfolder .ssh on your "control system".