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)
4 answers
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:
- 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).
- 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. - 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.
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.
Here is how I approached this problem and solved it.
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"Use the provided command line parameter. You need to use the portion after
-Wand connect it with the following partascp -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.
cd (change directory) to the directory where you want to download the data
- Run the command generated in step 2 in the command line.
you need the asperaweb_id_dsa.openssh file's absolute path!!!
Log in to answer this question.
I have tried (change putty to openssh),and it works:
What's the difference between
~/.aspera/connect/etc/asperaweb_id_dsa.opensshand/home/user/.ssh/id_rsa.pub? are they same?Same problem happened here. I applied dbGAP data and was required to use
ascpto 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 keys2, I have tried to use
id_rsaandid_rsa.pubgenerated byssh-keygen, but none of them work.Here is the command I used to download it (* is used to replace for confidential)
Hope to obtain some suggestion or help. Thanks.
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.