SSH putty upload/download and Linux VPs operations

Source: Internet
Author: User
Tags ftp client vps pscp

Use the psftp.exeand putty.exe in the puttyinstallation package to achieve your goal.

To use psftp.exe for upload, you only need to know the following four commands:

1. Open
Example: Open *** .dreamhost.com
-- Connect to the server. Replace "*** .dreamhost.com" with your own address.
2. CD
Example: CD blog/
-- Switch the directory on the server. Replace "blog/" with your actual path.
3. LCD
Example: LCD D:/site/upload/
-- Used to switch the local path, where D:/site/upload/is the D:/site/upload/in my own computer /. In this way, you can upload files in this directory or download files on the server to this folder.
4. Put
Example: Put wordpress.zip
-- Used to upload files. The uploaded file is D:/site/upload/wordpress.zip.

But please note!
1. The local path cannot be Chinese!
2. the upload speed is not faster or even slower than FTP.
3. the upload stability is higher than that of FTP.
4. There is no prompt on how many files have been uploaded. If it is a large file, it can only be silly.

 

 

SCP-RP/path/filename username @ remoteip:/path # copy the local file to the server
SCP-RP username @ remoteip:/path/filename/path # download the remote file from the server to the local device


Pscp usage of putty

When FTP is unavailable, it is convenient and secure.

Obtain sub-directories in the logged-on directory

Example: User user1

User1 Directory: pythondirectory, indext.html file,

1. Get all contents in the directory

Pscp-PW password-r username @ ipadress: Directory target_dir

-PW: Password

-R indicates that all contents in the directory are obtained.

Pscp-PW password-r username @ IPaddress: Python C:/home



2. Obtain a single file

Pscp-PW password username @ ipadress: index.html C:/home



You can also use psftp

CMD> psftp

Psftp> open yourhostname

Psftp> help # Get help information


Use Putty to upload and download local files

Maybe I want to use SSH
For those who upload or download local files, SSH
The advantage is that it makes the file more secure during transmission, but I don't think this is because of this. I just think that Putty is used for uploading files using FTP.
It is really silly to decompress Or compress. In fact, securecrt is used
It can be easily implemented, but it is a paid software, I don't like it, so I insist on using putty
.

Strictly speaking
Uploading local files or downloading files from Linux host to local is not putty
But through the psftp in the complete installation package.
. EXE file. Therefore, to complete these operations, you must have a complete putty in windows.
Installation package, not just putty
. EXE file.

The next step is to enable psftp.
. EXE, and putty
The same is the full-character interface. Compared with shell commands, only a handful of commands are used for uploading and downloading. The commands used are listed below:

  1. Open calpico.dreamhost.com is used to connect to a remote Linux server. Replace calpico.dreamhost.com with your own address.
  2. CD public_html/WP-content/is used to switch the directory on the remote Linux server. Replace public_html/WP-contnt with your actual path.
  3. LCD D:/downloads/
    It is used to switch the local path, where D:/downloads/is the D:/downloads/in my own computer. In short, the purpose of switching the local path is to upload the files in this directory
    Upload the files on the server to this folder. If you want to upload notepad.exe in the Windows folder on the C drive to the server, you need the LCD.
    C:/Windows /.
  4. Put notepad.exe uploads notepad.exe to the server.
  5. Get notepad.exe downloads notepad.exe to your computer.

After I used it, I found that uploading and downloading files has another advantage. Because it is a character interface, the file occupies a very small amount of system resources during uploading and downloading, and even cannot feel that it is running, it is much better to open an FTP client. There are also some disadvantages. Because the transmission progress is not visible, it would be silly if a large file is encountered.

 

 

 

 

Several useful parameters:

-V is the same as-V in most Linux commands. It is used to display the progress. It can be used to view the connection, authentication, or configuration error.

-C enable compression options.

-P: select the port. Note that-P has been used by RCP.

-4 Use the IPv4 address forcibly.

-6 Use IPv6 addresses forcibly.

-R recursively copy entire directories.

Copy local files to a remote machine

SCP-P 8022/etc/Lilo. conf my@www.upsdn.net:/home/My

Copy the local/etc/Lilo. conf file to www.upsdn.net.
========================================================== ==================

Copy the files on the remote machine to the local device

SCP-P 8022 my@www.upsdn.net:/etc/Lilo. CONF/etc

The/etc/Lilo. conf file in the http://www.upsdn.net is copied to the local/etc directory.

 

 

 

How can I download files through SSH?
So how to upload it ??

Upload may be used in the following cases ..

Suppose I made a website in dreamhost, And the development is good. There are a lot of content, but the access speed is definitely not as fast as in China, so I am going to move all the data back to China. At this time, we must first use SSH to package the backup.

The remote SSH packaging command is as follows:
Tar cfz geek.tar.gz Tool

/* The size after the upload file is about 10 MB */

After the compression package is completed, you need to transfer it to the new server. The traditional method is to log on to FTP, download the compressed package, and then log on to the new server to upload the compressed package.
At this time, if the file is small and the file is large, it will definitely take a lot of time. Very troublesome.

In fact, you can directly upload files to a remote server using SSH. The following is an example:

Assume that my compressed package is in code/mwpk.tar.gz and the remote server IP address qmun.com User: User Password: 123456

First, log on to ssh.
And go to the Code directory.

CD code/* Go To The Code directory
Ls/* list all files in this directory

The following is the command for uploading via ssh.

[Lenny] $ FTP/* Enable FTP Client
Ftp> open qmun.com/* Open the remote server IP Address
Connected to qmun.com.
220 ProFTPD 1.2.9 server ready.
Name (qmun.com: Root): User/* enter the user name
331 Password required for Oran.
Password:/* enter the password
230 user Oran logged in.

Put mwpk.tar.gz

/* This is the key. putis the Upload Command. The first mwpk.tar.gz is the local file name, and the second is the remote file name .. If you want to upload your mwpk.tar.gzto a remote ftpfile and name it mwpk.tar.gz, you can upload the file by yourself through SSH.

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.