Download File From Linux Server To Mac

To install Maven on Mac OS X operating system, download the latest version from the Apache Maven site, select the Maven binary tar.gz file, for example: apache-maven-3.3.9-bin.tar.gz. Extract the archive to your desired location. Adding Maven to the Environment Path. 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.

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

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:

  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:

For linux/Unix/Mac system, we can use a command-line tool “scp” to transferfiles between your laptop and Amazon instance. Also we can use a GUI tool“FileZilla” to do the transfer, which is more user-friendly.

Using scp to transfer data¶

“scp” means “secure copy”, which can copy files between computers on a network.You can use this tool in a Terminal on a Unix/Linux/Mac system.

To upload a file from your laptop to Amazon instance:

This command will upload a file - MS115.fa in your ~/Desktop/ folder ofyour laptop to folder ~/data/ on an Amazon instance. Note you still need touse the private key you used to connect to the Amazon instance with ssh. (Inthis example, it is the amazon.pem file in ~/Desktop/.

Note: You need to make sure that the user “ubuntu” has the permission towrite in the target directory. In this example, if ~/data/ was created by user“ubuntu”, it should be fine.

Similarly, to download a file from Amazon instance to your laptop:

Download File From Linux Server To Mac

This command will download a file /data/ecoli_ref-5m-trim.fastq.gz fromAmazon instance to your ~/Download folder in your laptop.

Note: You can use asterisk(*) to download multiple files, like *.fasta.gz.

Using FileZilla to transfer data¶

If you want a more user-friendly tool to transfer data, FileZilla is agood choice. It is free, it supports Windows/Linux/Mac systems, and it has agood user interface. It supports FTP, SFTP and other file transferprotocols.

Firstly, go to ‘https://filezilla-project.org/‘ and click “Download FileZillaClient” button to download it.

The interface of FileZilla is like this:

If you want to use FileZila to upload to or download data from a normalFTP server if you have the user and password, just put the information in the“Host”, “Username”, “Password” box and connect.However for Amazon instance, we use key-pair to log ininstead of password for better safety. So it is a little bit more complicatedto configure.

Open “Settings” and click “SFTP”:

Click “Add keyfile...”:

Then select the ”.pem” file you used to connect to Amazon instance with ssh.

There is a dialog box to ask you if you want to convert the ”.pem” fileinto a supported format. Click “Yes”.

Name it with extension as ”.ppk” and save it.

You will see the a private key has been added.

Close “Settings” and go back to the main interface.

Click button to open the site manager.

Linux Download All The Files

Click “New Site”.

Put the Amazon instance URL like ec2-54-166-128-20.compute-1.amazonaws.comin the “Host” box. Set “Protocol” as “SFTP”, “Logon Type” as “Normal”,“User” as “ubuntu” and leave “Password” as blank. Then click “Connect”.

Ubuntu Server

There will be a dialogue box to ask you about “Unknown host key”, just click“Ok”.

How To Download Zip File From Linux Server To Local Machine

All right. Now you have logged in the Amazon instance. You can drag and dropto transfer the files between the remote machine and your local laptop.