SSH. Command description

    SSH -- is the primary tool for remote server management. Also allows you to create tunnel connections and transfer files.

    Connection to server


    Client configuration

    SSH client can work without configuration file and get all necessary parameters at startup. But it's easier to work if you create a configuration file: ~/.ssh/config

        User root
        Port 222
        IdentityFile ~/.ssh/server_ed25519
    • - server address
    • User - username
    • Port - server port, default: 22
    • IdentityFile - private key file if key authorization is used

    Key creation

    ssh-keygen -t ed25519 -f ~/.ssh/server_ed25519
    • ed25519 - select the type of encryption, Ed25519 - optimal selection
    • ~/.ssh/server_ed25519 - path to the key file, where the public key will be created: ~/.ssh/

    Once started, the command will ask for a password. This is an additional level of security, this password must be specified when connecting to the server.

    The public key must be added to the file on the server ~/.ssh/authorized_keys. There can be multiple keys in a file.

    Copy file to server

    To copy files to the server, use the command:

    scp LOCAL
    • LOCAL - the path to the file on the local computer
    • - server address
    • REMOTE - absolute path to the file on the server

    Port forwarding

    From server to local computer:

    ssh -L 4000:
    • 4000 - port on the local computer
    • - address and port on the remote computer
    • -fNT - run SSH client in background

    For example in the local network of the remote server there is an IP camera with the stream address: rtsp://admin:123@

    For local forwarding:

    ssh -fNT -L 10554:

    Once started the stream can be opened in VLC: rtsp://admin:123@