Help me figure out how to drag data from the server to a laptop. Apparently, I do not quite understand how the scp command works.

I try to run the command on the server:

scp local_machine_name@local_machine_adress.com: file_from_server / directiry / in_local_machine

local_machine_name and local_machine_adress took from the second line of the /etc/hosts

    4 answers 4

    Use data not from /etc/hosts , but by IP address. You can learn it like this:

     ip -o addr show 

    Run a command on the laptop

     scp <имя_пользователя_сервера>@<IP_сервера>:/путь/к/файлу/на/сервере . 

    This command will copy the file to the current directory. If you want to copy to another directory - write the path to it instead of a point.

    If there are problems with the connection, then you will need to check that the network filter rules allow SSH connection from your IP and that the settings of the SSH daemon do not prohibit the connection of this user.

      Run on the local machine: scp server_user@server_adress:/path/to/file_from_server /directiry/in_local_machine

      • Did I understand the right place to get server_user and server_adress from? I got it: connection timed out - Tolkachev Ivan
      • one
        server_user is the username on the server, server_address is the server address (domain name or IP) - Alex Chermenin

      You can also use rsync rsync -avz username @ ipaddress: / path / path

        Scp

        scp osticket.ru.1.9.4.pre2.zip super@192.168.100.85:/home/super ### transfer the file to a remote server

        scp ваш_логин@имя_хоста.ru:file.txt /некоторая/директория ### retrieve the file from the remote server