How to Use SFTP
This will walk you through the basics of using SFTP to transfer files between your local computer and the cluster computers.
Windows - WinSCP
Logging in with WinSCP
When you first open WinSCP the login window should appear.
To login, enter the server hostname (ex. hodor.und.edu) and your IDM login.
Transferring files with WinSCP
After you log in, you will be presented with the main screen. On the left is your local machine and the server you have connected to is on the right.
To download a file from the server to your computer
- Navigate to the file on the server using the file browser on the right side
- Navigate to the location you want to download the file to on your local computer using the file browser on the left
- initiate the transfer using one of the following methods
- Click on the file and then click download up on the top bar
- This will bring up a new window that will allow you to adjust some settings
- once you have everything how you want it click ok to start the download
- Double click on the file to automatically start the transfer
- Drag the file from the left side to the right side. This will automatically start the transfer
- Click on the file and then click download up on the top bar
Uploading files from your computer to the server is the same process. The only difference is that you would click upload above the local file browser or move the files from left to right.
MacOS and Linux - Command Line
Logging in with the command line
Open Terminal and enter the following command: sftp first.last@hostname
Logging into hodor, it would look like this:
- sftp john.doe@hodor.und.edu
It will then ask for your password. Once you enter it the sftp prompt should be displayed:
- sftp>
Transferring files with the command line
At the sftp> prompt, use the cd
command to change to the directory of the file you want to transfer.
Use lcd local/download/path
to set the directory where you want the file to go on your local machine.
Once you are in the directory where your file is located, you can type:
- get filename
this will download the remote file to your machine.
If you want to upload a file, use:
- put local/path/to/file remote/path
Type quit
to exit the sftp> prompt.
Some commands
cd
- Change remote directorylcd
- Change local directoryget filename
- Download filename to local machinemkdir dirname
- Make new directory on remote machinelmkdir dirname
- Make directory on local machineput /path/to/local/file/file.exe /remote/path
- Upload file to the designated pathpwd
- Print the remote working directorylpwd
- Print the local working directoryrename /path/file.exe /path/file2.exe
- Change file name on remote machinerm
- Remove remote directorybye, exit, quit
- Quit SFTP.