PSFTP – How to Upload File to PuTTY

psftpputtyssh

For a school project we are required to use PuTTY only for the semester, we have a specific host that we are supposed to connect to, to upload the files and PuTTY to run them.

I have successfully connected to the host using PSFTP but don't know how to upload my files. I can connect successfully to the host but that's where everything ends. The local file is located here:

C:\Program Files\PuTTY\mpi_hello.c

I have no idea how to upload my files to the host and running ls only brings up the basic examples. And the destination file directory is:

/homes/01/c/student304

To be more specific I am trying to upload my local files to /homes/01/c/student304 using PSFTP, then run them from PuTTY.

The teacher will not show us how to upload files only how to run them once they're in the directory seeing as it's supposed to be a prequisite, but this is my first time ever using this software, so any help is greatly appreciated.

Best Answer

Does this tutorial from Purdue University help? Your teacher is (frankly) negligent in not showing you the basics, FWIW.

Anyway, the command to upload a file isput. So you would connect to the server and run:

put [filename]

With [filename] being the actual name/path to the local file.

This is an example from that tutorial page that shows you how to use various commands:

cd /home/ftp/users/jeff
del jam-old.tar.gz
ren jam.tar.gz jam-old.tar.gz
put jam.tar.gz
chmod a+r jam.tar.gz

So using that as a guide, this is how we can transfer from the C:\Program Files\PuTTY\mpi_hello.c to /homes/01/c/student304:

On your local machine, CD to your local project directory here:

chdir C:\Program Files\PuTTY\

Or:

cd C:\Program Files\PuTTY\

Now connect to the remote host and then run the following commands within PSFTP; the last line (chmod a+rx mpi_hello.c) is optional but it might be needed to allow the file to be read and executed by others:

cd /homes/01/c/student304
put mpi_hello.c
chmod a+rx mpi_hello.c

And that’s it! The file should be on the remote host at this location:

/homes/01/c/student304/mpi_hello.c

This stuff should work.

If you are still running into issues, review the tutorial from Purdue University for help. And if none of this helps? Please contact your teacher directly and ask them for further help. In fact, please share this answer with your teacher for reference.

Related Question