Command Line Interface of Globus Online

This week I am exploring command line mode of Globus online. Web-based Globus online is very easy to use and there are enough features for normal use. However, there are some limitations, for example you cannot change file names when you transfer. Command line mode enables more fine tuning of transfer and allows to modify details. Another example is you can specify name for each transfer, so you can keep track of each task more easily.

I am going to do this using Linux terminal but If you are window environment, one way to do it in command line is to install Cygwin. This software provides Unix/Linux like environment, so that you can run similar commands to Unix/Linux. Those who are already using Linux environment, it is not necessary to do anything. You can go to linux terminal and start there.

After installing Cygwin on windows machine, you go to Cygwin directory (usually C:\cygwin) and edit  Cygwin.bat file.

@echo off

C:
chdir C:\cygwin\bin
set CYGWIN=binmode ntsec
bash --login -i

After editing, save and double click Cygwin.bat file to run the program.  It will open a command line terminal you see below. Then type

cygrunsrv -h

If Cygwin is successfully installed, you will see options for cygrunsrv command.

ssh_test

CONNECTING USING SSH

OK, from here I will be doing everything in Linux terminal.  A lot of details are provided here (intro) , here (getting started) and here (beyond basics). So please refer these sites if you need more information. I am also assuming you already have user ID and several endopoints activated for Globus online. For the first time, you need to generate SSH Keys.

>ssh-keygen -t rsa -b 2048

It will generate a key in the file name called id_rsa.
It will also ask you to enter passphrase. Please remember what you type in.

Generating public/private rsa key pair.
Enter file in which to save the key 
(/home/user_name/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):

Open id_rsa.pub file and copy the entire content. Then go to Manage Identifies.Click “Add SSH Public Key box”. Enter alias (name) and paste the key in SSH Public Key. Click “Add SSH Key”.
public_key

Now, go back to Linux terminal, then try connecting your Linux to globus online. The format for connecting to globus online is

ssh globus_username@cli.globusonline.org

You may see an error message

Permission denied (publickey,gssapi-keyex,gssapi-with-mic
)."

This error is fixed by changing permission of this file to “read only”.

 chmod 400 /path/id_rsa.pub

Try ssh command again, this time hopefully you will see well come message after ask you enter passphrase that you specified above.

Welcome to globusonline.org, user_name. 
Type 'help' for help'
$

Now your machine is connected to globus online. Note that you see a ‘$’ on command line prompt.

TRANSFERRING FILES

Let’s try transferring some file using command line. The basic format for transfer is

transfer -- user_name#endpoint1/path/to/source/file
 user_name#endpoint2/path/to/destination/dir

Once the command is executed you will see a message.

Task ID: 26116978-2703-11e3-99f8-12313d2005b7
Created transfer task with 1 file(s)

There are a number of options you can use. To see all option, go here or type transfer -help.

If you want to change file name after transfer, you can put the file name in the destination directory.

RENEWING CREDENTIALS

You cannot transfer files if your credentials for the endopoint is expired. You need to renew credential if it is the case, type

endpoint-activate

This will prompt to enter username and password for each endpoint you have an access to.

If you want to activate specific endopoint, type

endopoint -m myproxy_server

It will prompt to ask you to enter username and password for this proxy server.

OTHER COMMANDS

There are a number of commands you can use in command line. mkdir can create a new directory. rename command can change the name of file or directory. ls is to show the content of remote server. Please refer here for more details.

If you want to quit command line mode of globus online, simply type,

quit

About bioinfomagician

Bioinformatic Scientist @ UCLA

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: