Download File From Linux Server To Mac

Someday you may need to get the SSL certificate of a website and save it locally.

If you want to be able to run scp on your Mac to download files from the Linux machine when it is behind NAT, you'll need to setup a port forward in your router to forward your public IP address port 22 to port 22 on the Linux PC's local IP-address. You'll then enter the public IP address when running scp on your Mac. Download File Using SSH. We can use SCP command to download the from remote server. For example I am going to download a file called “test.tar.gz” which is located on remote server example.com /opt directory in our local system /var directory. If you want to download the files to another local directory, switch to it by using the lcd command. Let’s say we want to download the files to the /ftpdownloads directory: lcd /ftpdownloads. To download a single file from the remote server, use the get command. For example, to download a file named backup.zip you would use the following. Transferring files to and from a UNIX server (terminal) You may copy files to and from a UNIX/Linux server in the Terminal window as well, using the 'scp' command. The syntax is either. Scp filetocopyfrom [email protected]:filetocopyto. Scp [email protected]:filetocopyfrom filetocopyto. Depending on whether you want to copy the.

For example, you could get an error saying that you can’t clone a Git repository due to a self-signed certificate and to resolve this issue you would need to download the SSL certificate and make it trusted by your Git client.

In the following article i am showing how to export the SSL certificate from a server (site URL) using Google Chrome, Mozilla Firefox and Internet Explorer browsers as well as how to get SSL certificate from the command line, using openssl command.

Cool Tip: Create a self-signed SSL Certificate! Read more →

Export SSL Certificate

Google Chrome

Export the SSL certificate of a website using Google Chrome:

  1. Click the Secure button (a padlock) in an address bar
  2. Click the Show certificate button
  3. Go to the Details tab
  4. Click the Export button
  5. Specify the name of the file you want to save the SSL certificate to, keep the “Base64-encoded ASCII, single certificate” format and click the Save button

Mozilla Firefox

Export the SSL certificate of a website using Mozilla Firefox:

  1. Click the Site Identity button (a padlock) in an address bar
  2. Click the Show connection details arrow
  3. Click the More Information button
  4. Click the View Certificate button
  5. Go to the Details tab
  6. Click the Export button
  7. Specify the name of the file you want to save the SSL certificate to, keep the “X.509 Certificate (PEM)” format and click the Save button

Cool Tip: Check the expiration date of the SSL Certificate from the Linux command line! The fastest way! Read more →

Internet Explorer

Download and save the SSL certificate of a website using Internet Explorer:

Linux Download

  1. Click the Security report button (a padlock) in an address bar
  2. Click the View Certificate button
  3. Go to the Details tab
  4. Click the Copy to File... button
  5. Click the Next button
  6. Select the “Base-64 encoded X.509 (.CER)” format and click the Next button
  7. Specify the name of the file you want to save the SSL certificate to
  8. Click the Next and the Finish buttons

OpenSSL

Get the SSL certificate of a website using openssl command:

Short explanation:

OptionDescription
-connect HOST:PORTThe host and port to connect to
-servername NAMEThe TLS SNI (Server Name Indication) extension (website)
certificate.crtSave SSL certificate to this file

Example:

Download File From Linux Server To MacDownload file from linux server to mac high sierra

You may not realize it, but your Mac already runs a variant of UNIX. You can easily access a terminal window to use your computer's built-in UNIX functionality with the 'Terminal' program (Applications/Utilities/Terminal.app). You may want to make a shortcut to this program in your Dock, since you'll be using it a lot from now on. Similarly, you can use your Mac directly to log into a UNIX server, and even to transfer files to/from a UNIX server.

Enabling X11-Forwarding (Popping up windows from the UNIX server)

Your Mac comes with another program that enables you to display graphics from programs running on a remote UNIX/Linux server, called 'XQuartz' (Applications/Utilities/XQuartz.app). On older OS X systems this program was called 'X11' and was located in essentially the same location. If neither of these programs are currently installed on your Mac, you can download XQuartz from the Mac App Store (free).

To enable forwarding, just run XQuartz/X11 before starting Terminal. If a xterm window pops up from XQuartz/X11, you may close that window before starting Terminal, since Terminal is more feature-rich than XTerm (my opinion). Once XQuartz/X11 is running, when you log into remote UNIX servers (as shown in the next section) you should be able to display remote graphics.

Logging into an UNIX server

The standard protocol for logging into a modern UNIX server is through using a Secure SHell (SSH) client. OS X has built-in SSH functionality, through the 'ssh' command in the Terminal.

To use ssh from the Terminal:

  • Open Terminal.
  • At the command line, type
    ssh username@hostname -CY
    or
    ssh username@hostname -CX
    (the Y vs X difference is minimal, and will not affect your user experience, just remember to use one of them). Here, username is your user name on the UNIX server, and hostname is the name of the UNIX server. For example, I could log into the UNIX server titan.smu.edu with the command
    ssh [email protected] -CY

For additional information on using ssh, type

man ssh

(short for manual) in the Terminal window.

Transferring files to and from a UNIX server (terminal)

You may copy files to and from a UNIX/Linux server in the Terminal window as well, using the 'scp' command. The syntax is either

scp file_to_copy_from username@hostname:file_to_copy_to

or

scp username@hostname:file_to_copy_from file_to_copy_to

depending on whether you want to copy the file to or from the UNIX server. For example, suppose I have a file named 'file1' in my home directory on titan, and I want to copy it to the current directory on my Mac (the one the terminal is in, type 'pwd' to see which directory you are in if unsure):

scp [email protected]:file1 .

or

scp [email protected]:file1 file1

would give the desired result. Suppose now that I have the file 'file2' in the current directory on my Mac that I want to copy to my home directory on titan:

scp file2 [email protected]:

or

scp file2 [email protected]:file2

would do the trick. For more information on the 'scp' command, type man scp in the terminal.

File

Transferring files to and from a UNIX server (graphical)

Fetch

Download File From Remote Server To Local Machine Linux

One of the most popular graphical file transfer options in OS X is the program Fetch. This is not a free program.

To use Fetch, fill in the UNIX hostname (e.g. titan.smu.edu), your username on that host (e.g. reynolds), and your password on that host, then click 'Connect'. You will then see a display of your remote directory on the UNIX server. Transfer files by dragging them to and from the Finder.

FileZilla

A free alternative to Fetch that may be used from OS X, Windows and Linux is is FileZilla. To install FileZilla in OS X:

  • Download the FileZilla client for Mac OS X from here.
  • Open the FileZilla installation file to unpack the application.
  • You may run Filezilla.app from the Desktop, or you can instead move it to your Applications folder.

Download File From Linux Server To Mac Os

To use FileZilla, fill in the fields for the host (e.g. titan.smu.edu), your username on that host (e.g. reynolds), your password, and the port (use 22 for SFTP), and hit [return]. You should notice two file browser windows open up, the browser on the left is on your computer, the browser on the right is from the UNIX host (e.g. titan). Transfer files by dragging them from one computer to the other with your mouse.

Download File From Remote Linux

D.R. Reynolds, 28 August 2014