What is CMShell?
CMShell = Content Management Shell, it provides limited shell-capabilities for end user to manage contents in NetStorage.
From help commands below, the following command is available once login:
|CMShell's built-in commands|
[EricMac /]$ help
az2z rewrite zip file to Akamai zip file format
cat concatenate files and print on the standard output
cd change directory
cp copy files and directories
debug view/toggle debug mode
du estimate file space usage
help list all commands
hostname show the system's IP address
ln make links between files
ls list directory contents
md5sum compute and check MD5 message digest
mkdir make directories
mv move (rename) files
pwd print name of current/working directory
rm remove files or directories
rmdir remove empty directories
sst a utility to retrieve files from the World Wide Web
stat print inode contents
unzip list, test and extract compressed files in a ZIP archive
wget a utility to retrieve files from the World Wide Web
How to use CMShell?
#1. Firstly you need to enable SSH login
using the following command to generate your SSH key-pairs
ssh-keygen -v -t rsa -b 2048 -C "<replaced with yourname to identify yourself>" -f Netstorage_SSH
-C "Any text" refers to the comments that you can add for the key to help identify the usage of the key and
-Netstorage_SSH refers to the name of the NetStorage key that you wish to give.
an example below:
|How to generate SSH key-pairs|
$ssh-keygen -v -t rsa -b 2048 -C "firstname.lastname@example.org" -f Netstorage_SSH
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in Netstorage_SSH.
Your public key has been saved in Netstorage_SSH.pub.
The key fingerprint is:
The key's randomart image is:
+--[ RSA 2048]----+
| . .. |
| .= . |
|.o +=.E |
|* *ooo. S |
|oB = . |
|o o . |
| . |
$ls -l Netstorage_SSH*
-rw------- 1 myan 600 1766 Sep 21 16:24 Netstorage_SSH
-rw-r--r-- 1 myan 600 397 Sep 21 16:24 Netstorage_SSH.pub
Now add and upload accoutn and paste your pubkey "Netstorage_SSH.pub", save it. Two hours later, you should be able to use SSH to connect to NetStorage.
#2. The syntax to log into NetStorage to use CMShell
ssh -t sshacs@<your_ns_account>.upload.akamai.com -i <your_private_key> cms
#3. Once you are in CMShell, the content in the NetStorage is at your command.
To remove all the content in a folder: #rm -f /path_to_your_folder/*
To remove all the apk files in a certain folder: # rm -f /path_to_your_folder/*.apk