To transfer files to or from a server using SFTP, use an SSH or SFTP client. Following are two commonly used clients.
WinSCP
Easily setup public / private key pair SSH on a server and client. Then, use ssh -i path to key to SSH into your server without a password. Improve your se. I am learning about SSH and how to use it to secure file transfers and commands between a windows machine and a Linux server. Everything that I have read so far indicates that I need to use an SFTP. SFTP protocol, clients, servers etc. Page by the original author of SFTP. DevOps & SysAdmins: SSH: Restrict sftp to a directory without jailing shellHelpful? Please support me on Patreon: https://www.patreon.com/roelvandepaarWith. Create the.ssh directory. The first thing you'll want to do is create a.ssh directory on your client.
- Open WinSCP. In the 'Host name' field, enter the hostname of the server to which you are connecting (for example,
bigred2.uits.iu.edu
orcarbonate.uits.indiana.edu
). - In the 'User name' field, enter your username for the host you specified.
- In the 'Password' field, type the password associated with the username you entered in the previous step.
- Click Login. Two-factor authentication using Two-Step Login (Duo) is required for access to the login nodes on IU research supercomputers, and for SCP and SFTP file transfers to those systems. SSH public key authentication remains an option for researchers who submit the 'SSH public key authentication to HPS systems' agreement (log into HPC everywhere using your IU username and passphrase), in which you agree to set a passphrase on your private key when you generate your key pair. If you have questions about how two-factor authentication may impact your workflows, contact the UITS Research Applications and Deep Learning team. For help, see Get started with Two-Step Login (Duo) at IU and Help for Two-Step Login (Duo).
When the software connects to your host, a window should appear with your local computer's directories on the left and the remote host's directories on the right. To move a file from your computer to the server, drag it from the left pane to the desired location in the right pane. To move a file from the server to your computer, drag it from the right pane to the desired location in the left pane.
PuTTY
Connect to a remote server
- To open the PSFTP part of the PuTTY application suite, from the Start menu, open PuTTY, and then PSFTP.
- With the PSFTP login window open, type
open
followedby the name of the host you are connecting to (for example,openkarst.uits.iu.edu
oropen mercury.uits.indiana.edu
). - If the
Store key in cache?
prompt appears, typey
. - At the login prompt, enter your username for the remote server.
- At the password prompt, enter your password associated with the username you entered in the previous step.Two-factor authentication using Two-Step Login (Duo) is required for access to the login nodes on IU research supercomputers, and for SCP and SFTP file transfers to those systems. SSH public key authentication remains an option for researchers who submit the 'SSH public key authentication to HPS systems' agreement (log into HPC everywhere using your IU username and passphrase), in which you agree to set a passphrase on your private key when you generate your key pair. If you have questions about how two-factor authentication may impact your workflows, contact the UITS Research Applications and Deep Learning team. For help, see Get started with Two-Step Login (Duo) at IU and Help for Two-Step Login (Duo).
Sftp And Ssh Port
Exploring the file system
Once logged into the server, you will see the following command-line prompt:
To move to a different directory, use the cd
command. For example, cd documents
will place you in the documents
directory.
To display your current directory location, use the pwd
command.
When exploring directories on your local computer, use the same commands, but add l
(lowercase L) at the beginning (for example, lcd documents
).
Display the contents of a directory
To display the contents of a directory on the server, enter dir
or ls
. To display the contents of a directory located on your computer, you must run a local command using !
. In this case, you would enter !dir
to display the contents of the current directory on your computer.
help
, or see Use SFTP to transfer files.Sftp Vs Ssh
Move a file from your computer to a server
Ssh Sftp Client
- Navigate to the directory containing the file you wish to transfer.
- Navigate to the directory on your computer file system to which you want to transfer the file.
- To transfer the file, type
put filename
, replacingfilename
with the name of the file you wish to transfer.
Sftp And Ssh
Move a file from a server to your computer
Sftp Without Ssh Command
- Navigate to the directory on your computer file system containing the file you wish to transfer.
- Navigate to the directory on the server file system to which you want to transfer the file.
- To transfer the file, type
get filename
, replacingfilename
with the name of the file you wish to transfer.