25

I have a folder on a Linux server and I have to transfer that file from there to my Mac desktop. I have never done it.

What is the best way to do that? I am trying to use terminal but is there any tool like WinSCP to do that?

1
  • 1
    In addition to the answers below, consider installing mc (aka Midnight Commander) to run on top of ssh. It behaves like nc on windows.
    – ott--
    Dec 11, 2012 at 20:53

5 Answers 5

26
  1. Install openSSH on the linux server. Assuming a debian based distribution, do this:

    sudo apt-get install ssh
    
  2. Open a terminal and copy the files:

    i. From Linux to Mac (run from the Linux machine):

    scp filename.txt user@remote_server:/Users/YOURNAME/
    

    ii. From Linux to Mac (run from the Mac):

    scp user@remote_server:/Users/YOURNAME/filename.txt .
    

The general syntax of the scp command is the following.

  1. To copy a file from the local server to the remote one:

    scp FILENAME user@remote_server:/remote/path/FILENAME
    
  2. To copy a file from the remote server to the local one:

    scp user@remote_server:/remote/path/FILENAME /local/path/FILENAME
    
3
  • 1
    If sshd is not running in Mac, Connection refused error will occur. So enable Remote Login in Preferences -> Sharing and then do this. Mar 26, 2020 at 2:07
  • In case someone gets port 22: Operation timed out, their server probably has a different port and it should be specified. scp -P 6418 user@remote_server:/Users/YOURNAME/filename.txt . Jun 18, 2020 at 1:09
  • In my case to transfer from Linux Mint 20.2 to mojave. In my linux terminal instead of this scp filename.txt user@remote_server:/Users/YOURNAME/ I only specify the folder at the end e.g.: scp filename.txt user@remote_server:Downloads
    – jdromero88
    Sep 28, 2021 at 23:01
3

WinSCP is a SFTP/SCP/FTP client for Windows.

Similar clients exist for the Mac - good examples are Transmit and Cyberduck.

Transmit and Cyberduck understand FTP, SFTP and WebDAV but it entirely depends how the linux server is set up whether you can access that particular folder with one of those services.

3

You can use SSH File Transfer Protocol, sftp from your Mac terminal.

Steps:

1. sftp user@remote_server

Enter the user@remote_server's password:

2. get /remote/path/FILENAME /local/path/FILENAME

Just in case you are not certain about the file name, you can change to the source directory and list the segments in your source directory

3. cd /remote/path
4. ls
5. get FILENAME_2 /local/path/FILENAME_2
0

If it's going to be a regular exercise, then have a look at installing OS X FUSE / MacFUSE, see:

0

Perhaps the easiest and most flexible way to transfer files to your Mac desktop from Linux is using Midnight Commander. To do so network the two machines, install mc on the Linux box, enable Remote Login on the Mac and use Shell login to connect to your Mac in Midnight Commander.

A sample connection string for shell logins looks like:

sh://[email protected]/

Use that in Midnight Commander if your Mac has a hostname mbp and is on the local network. For instructions with screenshots visit Copy Files from Linux to macOS Desktop.

You must log in to answer this question.