Key Passphrase For Ascp File Transfer (Ebi, Ncbi)
4
3
Entering edit mode
10.8 years ago
Gangcai ▴ 230

Dear all, I have one problem to use ASCP to download SRA files from EBI. When I try to download through ascp, it requires to enter in Key passphrase, however I couldn't find where to get it (searched around but no answer). Does anybody have some idea about this? Many thanks.

$ascp -QT -l 100m -i ~/bin/asperaweb_id_dsa.putty era-fasp@fasp.sra.ebi.ac.uk:/vol1/ERA012/ERA012008/sff/ ./
Key passphrase:
ascp: failed to authenticate, exiting.
Session Stop  (Error: failed to authenticate)
ncbi ascp aspera • 19k views
ADD COMMENT
1
Entering edit mode

I have tried (change putty to openssh),and it works:

ascp -QT -l 100m -i ~/.aspera/connect/etc/asperaweb_id_dsa.openssh era-fasp@fasp.sra.ebi.ac.uk:/vol1/ERA012/ERA012008/sff/library08_GJ6U61T06.sff ./
ADD REPLY
0
Entering edit mode

What's the difference between ~/.aspera/connect/etc/asperaweb_id_dsa.openssh and /home/user/.ssh/id_rsa.pub? are they same?

ADD REPLY
0
Entering edit mode

Same problem happened here. I applied dbGAP data and was required to use ascp to download it to my Linux server (Centos 7.0)

1, here, I am little confuse about several different keys: dbGAP account passwd, dbGaP repository key, Linux Server Key, ssh-keygen generated keys

2, I have tried to use id_rsa and id_rsa.pub generated by ssh-keygen, but none of them work.

Here is the command I used to download it (* is used to replace for confidential)

ascp -QTr -l 300M -k 1 -i "~/.ssh/id_rsa.pub" -W **** dbtest@gap-upload.ncbi.nlm.nih.gov:data/instant/**/84 .

Hope to obtain some suggestion or help. Thanks.

ADD REPLY
0
Entering edit mode

Is this an answer or a follow up question? If it does not answer the top level question, please do not add it as an answer.

ADD REPLY
5
Entering edit mode
9.9 years ago
barry.utah ▴ 50

I thought I'd add a comment here since I believe this is a more general problem and can still occur in way other than are resolved above. When the Aspera Connect command line client (ascp) can't read or access the key file it appear to respond in every case by asking for the passphrase. Here are a few things to try if this happens to you:

  1. Are you using the most recent version of the client AND the correct key file? (i.e. don't use the putty version of the key with the latests code as discussed above).
  2. Give the full path to the key file - I haven't tested this in all cases but on my MacBook the ascp client couldn't resolve the relative to the key file and it only worked when I gave the full path. The ~ wildcard worked because it is resolved by the shell to the full path.
  3. Make sure the permissions/ownership are correct on the key file. The current user should own the file and have permission to read.

It can be confusing because ascp never complains about missing files or bad permissions, but if it asks for a passphrase it's probably because it can't find/read the key file.

ADD COMMENT
1
Entering edit mode
4.3 years ago
Shicheng Guo ★ 9.5k

Okay. Here is another solution:

1, if you don't know where to find -i asperaweb_id_dsa.openssh, then rebuild aspera ascp, how to rebuild ascp (no root required, I use linux::Centos as an example, but ubuntu should be exactly same):

2, First download aspera ascp with the following command:

wget -qO- https://download.asperasoft.com/download/sw/connect/3.9.8/ibm-aspera-connect-3.9.8.176272-linux-g2.12-64.tar.gz | tar xvz

3, install it with this command:./ibm-aspera-connect-3.9.8.176272-linux-g2.12-64.sh

4, add ascp to you PATH with this command: export PATH=~/.aspera/connect/bin:$PATH

5, if you want to download data from dbGAP, you will receive -W TOKEN-STRING in you dbGAP accout.

6, download data from dbGAP with this following -i and -W:

 ascp -QTr -l 300M -k 1 -i ~/.aspera/connect/etc/asperaweb_id_dsa.openssh -W **** dbtest@gap-upload.ncbi.nlm.nih.gov:data/instant/sguo2jnj/77384 ./

7, last step, Decrypting Non-SRA Data with vdb-decrypt and NGCfile

for i in `ls *_enc`
do
echo \#\!/bin/bash > $i.job
echo \#SBATCH -p shared >> $i.job
echo \#SBATCH --mail-type=END,FAIL >> $i.job
echo \#SBATCH --time 02:30:00 >> $i.job
echo \#SBATCH --output $i.o >> $i.job
echo \#SBATCH --nodes 1 >> $i.job
echo \#SBATCH --ntasks-per-node=1 >> $i.job
echo vdb-decrypt --ngc prj_26365.ngc $i >> $i.job
sbatch $i.job
rm $i.job
done

If you have further question, try to contact me.

ADD COMMENT
0
Entering edit mode
8.2 years ago

Here is how I approached this problem and solved it.

  1. Set the path to the correct directory where ascp is installed. This path is different for various operation systems. On Mac OS X it should be ~/Applications/Aspera Connect.app/Contents/Resources. For the sack of convenience, I used a bash variable. On Mac OS X you just need to open terminal and copy/paste the following command:

    ASPERA_CONNECT_DIR="~/Applications/Aspera Connect.app/Contents/Resources"
    
  2. Use the provided command line parameter. You need to use the portion after -W and connect it with the following part

    ascp -QTr -l 300M -k 1 -i "$ASPERA_CONNECT_DIR/asperaweb_id_dsa.openssh"
    

    Therefore, you will get something like this:

    ascp -QTr -l 300M -k 1 -i "$ASPERA_CONNECT_DIR/asperaweb_id_dsa.openssh" -W aSequenceOfCharacters A@B.ncbi.nlm.nih.gov:data/C/name/number .
    

    Note: you need the . (dot) at the end too.

  3. cd (change directory) to the directory where you want to download the data

  4. Run the command generated in step 2 in the command line.
ADD COMMENT
0
Entering edit mode
8.0 years ago
Sophia Sue • 0

you need the asperaweb_id_dsa.openssh file's absolute path!!!

ADD COMMENT

Login before adding your answer.

Traffic: 2687 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6