1

I usually would get a prompt for a password but this time my terminal is asking for a passphrase for key.

rcihp145:qa1wrk13:/qa1users1/rgs/test/qa1wrk13/scripts>scp -p msingh2@rcihp145:/home/msingh2/set_run_jobs .
The authenticity of host 'rcihp145 (10.3.37.48)' can't be established.
RSA key fingerprint is 62:f9:d2:7e:d5:ac:bc:9d:0f:8f:82:d3:d4:a9:dc:f5.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/qa1users1/rgs/test/qa1wrk13/.ssh/known_hosts).

Enter passphrase for key '/qa1users1/rgs/test/qa1wrk13/.ssh/id_dsa': 

can i get an explanation or some solution for this key mapping.

  • Did you create private and public keys ? If not, someonelese did and entered a passphrase when keys have been created. – Luc M Jul 17 '12 at 17:23
2

There are two parts in this transcript. First, the client doesn't know who the server is, so it prompts you to verify the server's identity (everything up to “Are you sure you want to continue connecting?”). Then the client tries to write that you acknowledged this identity, but it fails (probably because it doesn't have the permission to write to /qa1users1/rgs/test/qa1wrk13/.ssh/known_hosts. You should either let the client store the server's identity, or add it to the file manually.

The second part, the last line, is about authenticating the user on the server. There are several methods for this; the most popular ones are a password (which you type every time you use ssh), or a key file (which can be protected by a passphrase, and if it is, you can enter that passphrase once per session.

For more details, read SSH key-based authentication: known_hosts vs authorized_keys

If you want to have a password prompt instead of a prompt for the key file's passphrase, tell the ssh client not to use the key file.

scp -o PubkeyAuthentication=no -p msingh2@rcihp145:/home/msingh2/set_run_jobs .
2

scp is using the ssh protocol to transfer files. Since you have a key file in your ~/.ssh/ directory, scp assumes that you want to use "password-less login" (see How can I set up SSH on Linux to log in password-less?) using that key. This key file, however, is protected by its own password, which you have to enter before the key can be used for encrypting your communication with the target computer.

In such a setup, you should have ssh-agent running. This program will keep track of the ssh keys you are using, and will ask you once per session for the password of a key file. In most desktop distribution, ssh-agent is started automatically at login, so you don,t have to worry about it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.