Copying a file from server to computer via SSH

We copy the file or files from our remote server to the local computer via the command line and the SSH protocol.

For convenience (and security), you should get rid of the password and transfer the connection to the server via SSH public keys.

Copy the file on Unix systems and on Mac OS:

scp root@111.111.111.111:/home/dir/file.txt /Users/ploshadka/Downloads/

Copy the directory along with the contents:

scp -r root@111.111.111.111:/home/dir /Users/ploshadka/Downloads

Preview which files are inside, and then copy with the first command above:

ssh root@111.111.111.111 ls /some/directory

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *