-->
- How To Download File From Linux Server To Local Machine Using Putty
- Download File From Linux Server To Windows
This article shows how to move files from your workstation up to an Azure Linux VM, or from an Azure Linux VM down to your workstation, using Secure Copy (SCP). Moving files between your workstation and a Linux VM, quickly and securely, is critical for managing your Azure infrastructure.
For this article, you need a Linux VM deployed in Azure using SSH public and private key files. You also need an SCP client for your local computer. It is built on top of SSH and included in the default Bash shell of most Linux and Mac computers and some Windows shells.
Quick commands
Nov 09, 2019 In Linux, you'll find NitroShare in the system tray. In Ubuntu, you can see it in the top panel. Clicking on the indicator applet will give you some options related to file transfer. You'll see option to transfer files, folders, viewing transfer history and configuration here. Click on Send Files and select the files to transfer. FileZilla Server. FileZilla is an open-source server that promises to fulfil all your basic FTP server. Securely downloading files with scp is aimed primarily at advanced users who are using ssh and the command line regularly in either macOS X, bsd, or linux. For those with adequate command line experience, using ssh and scp to download remote files is easy and, conveniently, after the file transfer has completed, the remote connection will end.
Copy a file up to the Linux VM
Copy a file down from the Linux VM
Detailed walkthrough
As examples, we move an Azure configuration file up to a Linux VM and pull down a log file directory, both using SCP and SSH keys.
SSH key pair authentication
SCP uses SSH for the transport layer. SSH handles the authentication on the destination host, and it moves the file in an encrypted tunnel provided by default with SSH. For SSH authentication, usernames and passwords can be used. However, SSH public and private key authentication are recommended as a security best practice. Once SSH has authenticated the connection, SCP then begins copying the file. Using a properly configured ~/.ssh/config
and SSH public and private keys, the SCP connection can be established by just using a server name (or IP address). If you only have one SSH key, SCP looks for it in the ~/.ssh/
directory, and uses it by default to log in to the VM.
For more information on configuring your ~/.ssh/config
and SSH public and private keys, see Create SSH keys.
SCP a file to a Linux VM
For the first example, we copy an Azure configuration file up to a Linux VM that is used to deploy automation. Because this file contains Azure API credentials, which include secrets, security is important. The encrypted tunnel provided by SSH protects the contents of the file.
The following command copies the local .azure/config file to an Azure VM with FQDN myserver.eastus.cloudapp.azure.com. The admin user name on the Azure VM is azureuser. The file is targeted to the /home/azureuser/ Download life360 on mac. directory. Substitute your own values in this command.
Copy a file up to the Linux VM
Copy a file down from the Linux VM
Detailed walkthrough
As examples, we move an Azure configuration file up to a Linux VM and pull down a log file directory, both using SCP and SSH keys.
SSH key pair authentication
SCP uses SSH for the transport layer. SSH handles the authentication on the destination host, and it moves the file in an encrypted tunnel provided by default with SSH. For SSH authentication, usernames and passwords can be used. However, SSH public and private key authentication are recommended as a security best practice. Once SSH has authenticated the connection, SCP then begins copying the file. Using a properly configured ~/.ssh/config
and SSH public and private keys, the SCP connection can be established by just using a server name (or IP address). If you only have one SSH key, SCP looks for it in the ~/.ssh/
directory, and uses it by default to log in to the VM.
For more information on configuring your ~/.ssh/config
and SSH public and private keys, see Create SSH keys.
SCP a file to a Linux VM
For the first example, we copy an Azure configuration file up to a Linux VM that is used to deploy automation. Because this file contains Azure API credentials, which include secrets, security is important. The encrypted tunnel provided by SSH protects the contents of the file.
The following command copies the local .azure/config file to an Azure VM with FQDN myserver.eastus.cloudapp.azure.com. The admin user name on the Azure VM is azureuser. The file is targeted to the /home/azureuser/ Download life360 on mac. directory. Substitute your own values in this command.
SCP a directory from a Linux VM
For this example, we copy a directory of log files from the Linux VM down to your workstation. A log file may or may not contain sensitive or secret data. However, using SCP ensures the contents of the log files are encrypted. Using SCP to transfer the files is the easiest way to get the log directory and files down to your workstation while also being secure.
The following command copies files in the /home/azureuser/logs/ directory on the Azure VM to the local /tmp directory:
The -r
flag instructs SCP to recursively copy the files and directories from the point of the directory listed in the command. Also notice that the command-line syntax is similar to a cp
copy command.
Next steps
You would frequently require to download files from the server, but sometimes a file can be very large in size and it may take a long time to download it from the server. Downloading large file from server using FTP is time consuming. You can download the file from the server, using command line, which can be done in a few minutes.
WPOven offers dedicated servers for your WordPress websites. We offer free SSD, SSL, Offsite backups, malware scanning & clean up. You can host unlimited sites with us & get WordPress dev & server support. Plans starting just $16.61 per month.
If the file is large or you want to download a full folder from the server then you can compress the file to formats like zip, tar, tar.gz etc. For this example we will Zip the file/folder. To download the file/folder, follow the below mentioned steps:
If you want to download a large file or a full folder then first zip your file or folder in order to compress it and then download it.
Step 1 : Login to the server using the SSH login details. You can use softwares are putty or Terminal to access your server from SSH.
Step 2 : Since we are using ‘Zip' for this example, the server must have Zip installed. Bridge builder download mac installer. To Install zip (incase you do not have it), type the following command
Step 3 : Compress the file or folder you want to download. In order to zip the file, type the following command
Cinema 4d for mac. For file :
where 'filename' is the name of the zip file which will be created and original_file is the name of the original file
For folder :
where 'example' is the name of zip file which will be created after the command and 'folder_name' is the name of folder which you want to zip
Step 4 : Now download the file using the following command
This command will store the file in the same directory where you run wget. If you want to store the downloaded file somewhere else, you may use -P option. The command for it :
If you have downloaded zipped file then follow the following steps in order to get the original files
Step 5 : Install unzip (if you do not have) on your local machine. In order to install the unzip, type the following command
Step 6 : Navigate to the directory where the file is downloaded via command line
How To Download File From Linux Server To Local Machine Using Putty
Step 7 : Type the following command
Download File From Linux Server To Windows
where 'example.zip' is the file name of zipped file.