Transfer files to your Linux instance using the PuTTY secure replication client

Source: Internet
Author: User
Tags pscp amazon ecs




Transfer files to your Linux instance using the PuTTY secure replication client

The PuTTY Secure replication client (PSCP) is a command-line tool that you can use to transfer files between a Windows computer and a Linux instance. If you prefer a graphical user interface (GUI), you can use an open-source GUI tool called "WinSCP". For more information, see Transfer files to your Linux instance using WinSCP.

To use PSCP, you will need to convert the private key generated in your private key using PuTTYgen. You also need a public DNS address for your Linux instance.

The following example Sample_file.txt transfers a file from a Windows computer to a directory in a Linux instance /usr/local :

c:\> pscp-i C:\KEYS\MY-KEY-PAIR.PPK C:\Sample_file.txt [email protected]_dns:/usr/local/sample_file.txt


In practice, the example uploads all content under the e:/class/weimi/ folder to /home/wwwroot/weimi .

Pscp-i C:\Users\Administrator\Desktop\amazon\my-key-pair.ppk-r "e:/class/weimi/" [Email protected]:/home/wwwroot/ Weimi


PSCP detailed

http://ihuangweiwei.iteye.com/blog/1181062


Transfer files to your Linux instance using WinSCP

WinSCP is a GUI-based file manager for Windows that allows you to upload and transfer files to a remote computer using the SFTP, SCP, FTP, and FTPS protocols. With WinSCP, you can drag and drop files from a Windows computer onto a Linux instance or synchronize all directory structures between the two systems.

To use WinSCP, you will need to convert the private key generated in your private key using PuTTYgen. You also need a public DNS address for your Linux instance.

  1. Download and install WinSCP from http://winscp.net/eng/download.php. For most users, the default installation option is available.

  2. Start WinSCP.

  3. In the WinSCP login (WinSCP login) screen, for host name (hostname), enter the public DNS address of the instance.

  4. For user name (username), enter the default AMI user name. For Amazon Linux Amis, the user name is ec2-user . For Red Hat Amis, the username is root , and for Ubuntu Ami, the user name is ubuntu .

  5. Specify a private key for your instance. For private key, enter the path to your private key or click... button to browse for the file. For the WinSCP version of the update, you need to click Advanced to open the premium site settings, and then under SSH , click Authentication (authentication) to find the Private The key file (private key files) setting.

    Note

    WinSCP requires PuTTY private key file ( .ppk ). You can use PuTTYgen to .pem convert the security key file into a .ppk format. For more information, see Convert your private key using PuTTYgen.

  6. Optionally, in the left panel, click Remote directory (directory), and for directories (remote directory), enter the directory path where you want to add the file. For an updated version of WinSCP, you need to click Advanced to open the premium site settings, and then under Environment (Environment) , click Directories (directory) Look for remote directory settings.

  7. Click login to connect, and then click Yes to add the host thumbprint to the host cache.

    650) this.width=650; "Src=" https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/images/ Winscp-connection.png "alt=" Winscp-connection.png "/>

  8. After the connection is established, in the Connection window, your Linux instance appears on the right and the local computer appears on the left. You can drag and drop files directly from the local computer to the remote file system. For more information on WinSCP, see the project documentation in Http://winscp.net/eng/docs/start.

    Note

    If you receive an " Cannot execute SCP to starttransfer " error, you must first install the SCPon your Linux instance. For some operating systems, this command is in the openssh-clients package. For Amazon Linux variants (such as Amazon ECS-optimized Amis), install the SCPusing the following command.

    [Ec2-user ~]$ sudo yum install-y openssh-clients


Transfer files to your Linux instance using the PuTTY secure replication client

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.