Can You Upload Files From Your Computer Throuh Putty

How to upload and download files through SSH using PuTTY (for Windows users)

In this tutorial we'll bear witness you how to transfer files from your local computer to your hosting business relationship and vice versa through SSH (Secure Beat) using PuTTY. PuTTY is an application with which Windows users tin can connect to their hosting accounts through SSH and execute commands, transfer files, etc. To learn more near PuTTY, where to detect it, how to configure it and what you lot take to exercise to connect to your business relationship through SSH, read the tutorial on connecting to your account through SSH (for Windows users).

In this tutorial nosotros presume that you already take installed the whole PuTTY installation bundle on your local computer and you know how to configure information technology to connect to your account.

As yous have probably noticed the PuTTY installation parcel contains several other applications, besides PuTTY itself. These include Pageant, PSCP, PSFTP, etc. What you need for file transferring is either PSCP or PSFTP:

PuTTY Applications

SCP (Secure Copy) and SFTP (SSH File Transfer Protocol) are network protocols which apply SSH for file transfer. When it comes to transferring speed, they are a bit slower than the more commonly used FTP just they are much more secure.

PSCP and PSFTP are the PuTTY applications for transferring files over SCP and SFTP. SFTP is a newer protocol designed to piece of work with SSH-ii (Secure Shell version 2). Despite its proper name, PSCP also uses SFTP as its first option for transferring files when the server to which PSCP is connected is an SSH-2 server. Practically all servers, including HostKnox servers, are SSH-ii servers.

The main difference between PSCP and PSFTP is that PSCP is primarily used for downloading and uploading files (it can also be used to list files in a remote directory). PSFTP is more similar an FTP client (e.g. FileZilla), significant that it can be used not just to transfer files, but also to browse the files and folders on your account, to delete them, etc. PSFTP and PSCP are, however, control line applications. This means that they are used through the Control Prompt of your Windows operational system and yous take to type the commands manually.

So, to offset PSCP or PSFTP you lot take to start the Control Prompt outset. To do this, click on the Windows Outset push button in the lower left corner of your screen, and so click on Run... and in the window that opens type cmd and click on OK. This volition launch the Command Prompt from which you can start PSCP or PSFTP.

In club to connect to your account and transfer files y'all also have to start Pageant and add your private SSH fundamental. For more than information on this check the tutorial on connecting to your account through SSH using PuTTY.

Showtime we'll get over PSCP and we'll show you how to outset it and use it to transfer files from your local figurer to your hosting account and vice versa. To start it, you take to type a command in the Command Prompt to add together PSCP to the system path. If, for case, you lot accept installed all the PuTTY applications in a folder called putty on your local D drive, the command should look like this: set up path=%path%;d:\putty. After you type it press Enter on your keyboard to execute the command.

Command Prompt PSCP Start

Later on you lot do that you're ready to type commands to transfer files with PSCP. To upload a file from your local calculator to the public_html directory on your account (the directory where you accept to put the files yous demand for your site), you lot have to execute a command in the Command Prompt that looks like this:

pscp d:\documents\example.txt username@eastward.hostknox.com:/home/username/public_html

This command will transfer a text file called instance.txt from the documents folder on your local D drive to the public_html directory on your account. Yous take to supersede username in both places with your bodily master username and, if needed, the server name. The part betwixt the @ symbol and the colon is the address of the server and the part after the colon is the path to the public_html binder (/habitation/username/public_html).

To download a file from your business relationship to your local computer just type outset the path to the file on your hosting account and then the place on your local estimator where yous want to download information technology:

pscp username@e.hostknox.com:/home/username/public_html/example.txt d:\documents

The simply spaces in the pscp command are subsequently pscp and between the ii paths. If y'all desire to upload a file which has spaces in its file name (or the directory containing it has spaces), you have to put the whole path to the file on your local figurer in quotation marks. The aforementioned has to be washed if you download a file on your local reckoner in a directory that has spaces in its name. For instance, yous desire to upload a file called my example file.txt from a folder chosen documents on your local D bulldoze to the public_html directory on your account:

pscp "d:\documents\my case file.txt" username@e.hostknox.com:/abode/username/public_html

If yous want to download the same file (a file with spaces in the name) from your hosting account, you only need to put quotation marks around the file name:

pscp username@e.hostknox.com:/habitation/username/public_html/"my example file.txt" d:

The above command will download a file chosen my instance file.txt from your account to the D bulldoze on your local computer.

Observe also that when you specify the path to your account yous take to utilize forrard slashes (/) while for the path on your local computer you accept to utilize backward slashes (\).

The above commands will only work for single files. You can transfer multiple files by using wildcards (*). For example, the following control will download all the files (without any subdirectories) inside the documents folder from you account to the D drive on your calculator:

pscp username@eastward.hostknox.com:/home/username/public_html/documents/* d:

If yous want to transfer a directory together with all the files and subfolders in it, yous have to add the choice -r. For instance:

pscp -r d:\documents username@e.hostknox.com:/home/username/public_html

The above command will upload the unabridged documents folder with everything inside it from your local computer to the public_html directory on your business relationship.

A tip that may save yous some fourth dimension: by pressing the upwardly pointer key on your keyboard yous can browse through the previous commands that you have executed. With the left and right arrow keys you tin can move the line cursor to right mistakes in your commands.

At present, allow'south motility to PSFTP. To start PSFTP, open up the Command Prompt and use the same command every bit with PSCP to add PSFTP to the system path (e.g. set up path=%path%;d:\putty). Don't forget that yous besides need to start Pageant and add your private SSH key. After you lot execute the prepare path command, you only need to type psftp followed past a space and your master username and the name of the server: e.one thousand. psftp username@due east.hostknox.com.

This volition log you in your account in the directory /home/username. Besides transferring files, you lot can use Unix/Linux commands to scan and manage the files and folders on your business relationship. For case, in one case you're logged in if you type just ls and printing Enter you'll see a list of the directories within /home/username. One of them is the public_html directory. You lot can open that folder and get in your current working directory by typing cd public_html. With cd .. you'll open the parent directory of your current directory. Here is a list with some useful commands:

ls - shows the content of the current directory

cd directoryname - changes the current working directory to the one specified (the specified directory has to be a subdirectory of the electric current one, otherwise you lot have to type the full path)

cd .. - go i directory up

mkdir newfolder - creates a new directory called newfolder within the electric current directory

rm filename - deletes a file with the specified name (eastward.thou. filename); the file has to exist in the current directory or yous have to type the total path

rmdir directoryname - deletes a directory, it has to be empty

lcd directoryname - changes the current working directory on your local computer to the i specified; for case, lcd d:\documents volition alter the working directory on your local calculator to the documents folder on the D drive

lpwd - displays the name of the current working directory on your local computer

At present, allow'southward go dorsum to the principal purpose of PSFTP: transferring files. Files tin can be downloaded with the get control:

get /dwelling house/username/public_html/examplefile.txt d:\documents\examplefile.txt

You accept to replace username with your actual principal username.

The above control will download a file called examplefile.txt from the public_html directory on your business relationship to a folder called documents on your local D drive. Observe that here with the command in the higher up class we accept also specified the proper noun of the target file that we're going to save on the local computer (d:\documents\examplefile.txt). This has to be washed when you're downloading a file to a directory on your local computer that is not your current working directory. Unlike PSCP, where if you don't specify a name the file will be saved with the original proper noun, with PSFTP if you don't specify a name for the file the become control might not piece of work. Y'all have the selection whether to utilise the aforementioned name for the target file or to use a different ane, just in both cases the content of the file will be the same as that of the source file.

Since with PSFTP yous tin scan and alter the working directory on your account (cd control), yous don't have to type the full path to the file on your account that you want to download. Using the in a higher place instance, if you use the cd command (e.k. cd public_html) to brand public_html the current working directory on your business relationship, the control would expect like this:

get examplefile.txt d:\documents\examplefile.txt

The same is true for the current working directory on your local computer. If y'all change information technology with the lcd command to d:\documetns (lcd d:\documents) the above command would look similar this:

go examplefile.txt examplefile.txt

Assuming the working directory on your business relationship is public_html and the working directory on your local computer is d:\documents, the to a higher place command volition download a file chosen examplefile.txt from the public_html directory on your account to the documents folder on your local D drive. In this example you don't even have to type the proper noun of the target file when y'all download it to the current working directory on your computer. You lot can merely employ get examplefile.txt and the file volition exist downloaded in your working local directory with the same name equally the source file.

To download a directory with all its content (including subdirectories), you take to add together, as with PSCP, the selection -r:

get -r newfolder d:\newfolder

The above control volition download a directory called newfolder from the current directory on your business relationship to the D drive on your local computer. If you don't specify a name for the directory on you local drive (eastward.k. get -r newfolder d:) PSFTP will download just the contents of newfolder to your local D drive without the folder itself. Then the contents of newfolder volition be scattered on your D drive. This, as with files, is the case when the electric current working directory on your local figurer is not your local D drive. If the working directory on your local computer is the D bulldoze, you can just utilize get -r newfolder. This will download not merely the contents simply also the binder itself to the working directory on your computer (D drive in this case). Again, equally with files, if yous desire to y'all tin specify a dissimilar proper name for the target directory (e.g. get -r newfolder newfolder1).

With the command mget you lot can download multiple files at the same fourth dimension. For case, mget examplefile1.txt examplefile2.txt will download the two files from the current working directory on your business relationship to the current working directory on your local calculator. With the -r option you can use mget to download multiple directories (eastward.one thousand. mget -r dir1 dir2).

The PSFTP command for uploading files is put. Basically the same rules apply to this command as the ones for go. Only in this example first you specify the file and path on your local computer and then on your account:

put d:\documents\examplefile.txt /dwelling house/username/public_html/examplefile.txt

The above command will upload a file called examplefile.txt from the documents folder on your local D drive to the public_html directory on your business relationship. Similarly to the become command, if you are uploading a file to a directory that's not your current working directory y'all have to specify not only the path on your business relationship simply also the name with which the file will be saved.

If you're uploading the aforementioned file equally in the to a higher place example but you have inverse the current working directory on your local computer to d:\documents and the working directory on your account to public_html, you lot just need the command:

put examplefile.txt

With the put control you lot tin can besides use the -r option to upload a directory together with its subdirectories and files (eastward.chiliad. put -r exampledir). You can use mput to upload multiple files at once (eastward.thousand. mput examplefile.txt examplefile1.txt) or mput -r to upload multiple directories (east.g. mput -r exampledir exampledir1).

Another thing useful to know is that with both commands (put and get) if the file proper name or directory name has spaces in it, you take to put quotation marks around the proper name (east.g. put "my case file.txt").

jacksonterid1965.blogspot.com

Source: https://www.hostknox.com/tutorials/ssh/putty/file-transfer

0 Response to "Can You Upload Files From Your Computer Throuh Putty"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel