Using PuTTY as an SFTP client

PSFTP is the Secure File Transfer Protocol client of PuTTY.

Differences between PuTTY PSFTP and OpenSSH SFTP

The PuTTY PSFTP client offers a subset of OpenSSH SFTP commands, and is compatible with NetStorage. PuTTY's PSCP client has an -sftp backend mode of operation that works likes PSFTP. There are differences between the PuTTY and OpenSSH SFTP clients:

  • Limited globbing support: The PuTTY PSFTP client doesn't support “globbing” (wildcard characters) as fully as the OpenSSH client; this also affects PSCP in the -sftp backend mode.
  • Limited constructs and commands: The PuTTY PSFTP client doesn't support these constructs or commands in either interactive usage or “batch” mode:
    • Leading # characters aren't treated as comments as they are with the OpenSSH client; they are treated as syntax errors.
    • Globbing expressions (wildcard characters) are not supported.
    • The get and put commands have no option to preserve transferred files’ permission and access time attributes. There is no [-P] option like there is with the OpenSSH client.
    • There is no symlink command.
    • These PuTTY PSFTP commands aren't present in the OpenSSH SFTP client, and aren't supported with NetStorage:
      • reget (resume download): The client tells the server to seek to the position corresponding to the end of the portion of the file on the client, and to transfer the remaining bytes.
      • reput (resume upload): The client queries to see how much of the file exists on the server, and then only uploads the remaining portion of the file.
        Note: When performed on NetStorage, reput will always result in a full upload.

Example PuTTY PSFTP connection

Use these variables during the connection process:

  • <Username>: When providing the username, the value sshacs must be used. (This is the case for all secure access methods in NetStorage.)
  • <private key>: Apply your private SSH key for this upload account.
  • <Domain Name Prefix>: This value followed by .sftp.upload.akamai.com represents your full Upload Domain Name. You set up your domain name during creation of the target storage group.
Command description Command and output
Example PuTTY SFTP connection

This example uses the PuTTY SFTP client from a command line. It uses an example Domain Name Prefix of nsmediadocs and the sftp.upload.akamai.com upload domain.

psftp -i <private key>.ppk sshacs@nsmediadocs.sftp.upload.akamai.com
Connected to sshacs@nsmediadocs.sftp.upload.akamai.com.
Display the local working directory

This example uses the lpwd command to display the present working directory on your local machine.

psftp> lpwd
Current local directory is C:\files
Display the remote working directory

This example uses the pwd command to display the present working directory on the server.

psftp> pwd
Remote directory is /movies
Upload a single file

This example uploads the local subtitle.srt file to the remote /movies directory by using the put command.

psftp> put subtitle.srt
local:subtitle.srt => remote:/movies/subtitle.srt
List the remote working directory

This example performs a directory list ls on your remote server. This includes hidden dotfiles by default.

psftp> ls
Listing directory /movies
-rw-rw-r--    0 writingteam storage         0 Jun  5 18:52 .dotfile
-rw-rw-r--    0 writingteam storage     41392 Jun  9 23:28 movie.mp4
-rw-rw-r--    0 writingteam storage      5029 Jun  9 21:58 subtitle.srt
drwxrwxr-x    0 writingteam storage         0 Jun  9 22:20 tmp

Incorporating the “Private Key”

Consult the PuTTY documentation for details on incorporating the “Private Key” file associated with the SSH key applied to the NetStorage upload account in use.