3 horizontal lines, burger
3 horizontal lines, burger
3 horizontal lines, burger
3 horizontal lines, burger

3 horizontal lines, burger
Remove all
LOADING ...

Content



    How to generate and use a SSH keys

    Clock
    26.02.2026
    /
    Clock
    11.03.2026
    /
    Clock
    2 minutes
    An eye
    84
    Hearts
    0
    Connected dots
    0
    Connected dots
    0
    Connected dots
    0

    Introduction: How the SSH Protocol Works

    It will be a relatively small article about how to make a pair of public/private keys for authentication via SSH protocol. Following this, you will learn how to transfer these keys to a remote server and, most importantly, how to use them.
    SSH (Secure SHell) is a cryptographic network protocol that provides a secure way to operate network services, such as remote login and file transfers, over an unsecured network like the internet.
    To be able to use this protocol for communication with a remote server, you can use either a password or a pair of public/private keys.
    How does it work? First of all, you need to generate a pair of public/private keys on the machine from which you want to connect to the remote server. The private key you keep on the original machine, but the public one you send to the remote server. After a successful transfer, you can log in to the remote server without entering a password. Using key-based authentication is, in any way, faster and more secure and not so annoying.

    Generate, transfer, and connect to the server by SSH keys

    Let's just clarify one thing: keys pair need to be generated on the machine from which you want to connect to the remote server. Now, how to generate those keys pair:
    ssh-keygen -t ed25519
    You will be requested to enter a passphrase; you can skip this step.
    Now you need to transfer the generated key, the public one. For this to happen, use this command:
    ssh-copy-id -i .ssh/server-key.pub -p 22 root@1.1.1.1
    1. Flag -i - the path to the public key on the local machine
    2. Flag -p - the port for connection by SSH Protocol
    3. root - the user name by which we will interact with the remote server
    4. 1.1.1.1 - the address of the remote server; it can be a domain name too, if there is one connected
    You will be asked to enter a password for the first and the last time. Just do it.
    After this, you will easily be able to log in and log out from the server, just using a single command, without additional requests to enter a password. But you need to type a path to the public key like this:
    ssh root@1.1.1.1 -i .ssh/hoster-cloud-btcpay


    Do not forget to share, like and leave a comment :)

    Comments

    (0)

    captcha
    Send
    LOADING ...
    It's empty now. Be the first (o゚v゚)ノ

    Other

    Similar articles


    Why and how to solve server response delay, err_http2_ping_failed error, my investigation and solution

    Clock
    29.09.2024
    /
    Clock
    11.03.2026
    An eye
    3357
    Hearts
    0
    Connected dots
    0
    Connected dots
    0
    Connected dots
    0
    In this article, I will describe in detail how I solved the problem of server response delays (err_http2_ping_failed) to client requests. I will describe the operation of the ERR_HTTP2_PING_FAILED error …

    How to Run Django Server: 4 Ways (runserver, Gunicorn, Nginx) | Complete Guide

    Clock
    17.10.2025
    /
    Clock
    11.03.2026
    An eye
    750
    Hearts
    0
    Connected dots
    0
    Connected dots
    0
    Connected dots
    0
    A complete guide on launching a Django server. Learn 4 essential methods: from the default runserver for development to using WSGI/ASGI, Gunicorn, and Nginx for a live (production) environment.