SFTP examples using OpenSSH

These examples show you how to connect with SFTP and issue basic commands.

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 OpenSSH SFTP connection

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

sftp -i <private key> 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.

sftp> lpwd
Local working directory: C:\files
Display the remote working directory

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

sftp> pwd
Remote working directory: /movies
List the local working directory

This example uses the lls command to perform a local directory list on your local machine.

sftp> lls
 
 Directory of C:\files

06/05/2020  01:52 PM    <DIR>          .
06/05/2020  01:52 PM    <DIR>          ..
06/05/2020  11:50 AM            41,392 movie.mp4
               1 File(s)         41,392 bytes
               2 Dir(s)  38,636,281,856 bytes free
Upload a single file

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

sftp> put movie.mp4
Uploading movie.mp4 to /movies/movie.mp4
movie.mp4            100%   40KB  40.4KB/s   00:00
List the remote working directory

This example performs a directory list ls -l on your remote server.

sftp> ls -l
-rw-rw-r--    0 writingteam storage     41392 Jun  5 18:39 movie.mp4
Don't include hidden dot files

By default, the ls command doesn't show hidden dotfiles.

sftp> ls -l movies
-rw-rw-r--    0 writingteam storage     41392 Jun  5 18:39 movie.mp4
Include hidden dot files

Use the ls -a command option to include hidden dotfiles.

sftp> ls -a -l movies
-rw-rw-r--    0 writingteam storage         0 Jun  5 18:52 .dotfile
-rw-rw-r--    0 writingteam storage     41392 Jun  5 18:39 movie.mp4