Mac Terminal SSH file transfer?

103,497

Solution 1

Yes, you can use scp , which basically cp over ssh. It can work either way also, so:

scp ~/Document/Localfile remoteuser@remotemachine:~/Desktop

or

scp remoteuser@remotemachine:~/Destkop/remotefile ~/Desktop

The first command would copy a file to the remote machine, the second would copy a file from the remote to the local. The syntax is <user>@<machine or ip>:<file> you can do a man scp for more switches and options

Solution 2

The scp command on Linux is how you do file transfers using SSH

Solution 3

Here is quick way of copying files using uuencode/uudecode and clipboard.

In terminal, while having connection opened on remote machine:

press CMD + K to clear the window
clear; uuencode filename < file

Then select and copy all text from the terminal window (CMD + A, CMD + C). Now open new terminal window, on your local system and do:

uudecode

Now press CMD + V now to paste uuencoded content of your file. Press CTRL + D after that to finish input to uudecode program. uudecode will create your file locally, under the name 'filename'.

Solution 4

scp is the command you want. You need to have SSH logins enabled on the destination computer, and know the username and password for the destination computer.

scp file.txt user@destination-computer:/Users/user/Documents/file.txt
Share:
103,497

Related videos on Youtube

User19
Author by

User19

Updated on September 18, 2022

Comments

  • User19
    User19 over 1 year

    Is there a way to transfer files directly from a Mac to another using only Terminal? Perhaps using SSH?

  • Ryan Gibbons
    Ryan Gibbons almost 13 years
    No problem, please remember Gordon Davisson info below wrt Mac Metadata and the -E option
  • Admin
    Admin almost 2 years
    Remember to use scp -r to copy entire folders/dirs