The following examples show how you would use the PuTTY tool to transfer files using SCP.
The syntax of (PuTTY) SCP command-line is:
pscp [-pqrvBC46] [-F ssh_config] [-S program] [-P port] [-c cipher] [-i identity_file] [-o ssh_option] [[user@]machine1:]file1 [...]
[[user@]machine2:]file2
In this command line:
user
can be any WS_FTP Server user. If the ‘username’ does not explicitly include a WS_FTP hostname, WS_FTP SSH server will use the default hostname for authenticating the user.
For example, to connect to the default host of WS_FTP SSH server running on machine ‘MACHINE1’ with the credentials of USER1, use: USER1@MACHINE1 in the SCP command-line.
If the username explicitly includes the WS_FTP hostname (separated by current host separator character), WS_FTP SSH server uses the specified hostname for authenticating the user.
For example, if the current host separator character for WS_FTP server is *, then, to connect to the host HOST2 of WS_FTP SSH server running on machine MACHINE2 with the credentials of USER2, use: USER2*HOST2@MACHINE2
in the SCP command-line.
Using the PSCP (PuTTY) SCP tool, to download the file a.txt to the current directory on the client machine from the home folder of User1 (of the default host) of WS_FTP Server with SSH running on Machine1 using the credentials of User1, use the following command:
PSCP.exe -P 22 -l User1 -pw password -2 -4 -scp User1@Machine1:./a.txt
To download the folder ‘MyDocuments’ (and all files/sub-folders underneath this folder) to the current directory on client machine from the home folder of User1 (of the default host) of WS_FTP Server with SSH running on Machine1 using the credentials of User1, use the following command:
PSCP.exe -r -P 22 -l User1 -pw password -2 -4 -scp User1@Machine1:./MyDocuments .
Using the PSCP (PuTTY) SCP tool, to upload the file a.txt from the current directory on the client machine to the home folder of User1 (of the default host) of WS_FTP Server with SSH running on Machine1 using the credentials of User1, use the following command:
PSCP.exe -P 22 -l User1 -pw password -2 -4 -scp a.txt User1@Machine1:.
To upload the folder ‘MyDocuments’ (and all files/sub-folders underneath this folder) from the current directory on client machine to the home folder of User1 (of the default host) of WS_FTP Server with SSH running on Machine1 using the credentials of User1, use the following command:
PSCP.exe -r -P 22 -l User1 -pw password -2 -4 -scp MyDocuments User1@Machine1:.
If you are uploading from a Unix system, remember that file names on the WS_FTP Server are not case sensitive, as it runs on Windows operating systems.