0

I can login to a remote server with a login, which has a private key. This private key is without any password. When using PuTTy on Windows, I can login to that remote server without problems given that private key. Using pscp on Windows with this key also works without any problems.

But when using scp from linux with that same key, it seems not to work. The last messages from scp are these

debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /path/to/key/id_rsa_download2.ppk
debug1: key_parse_private2: missing begin marker
debug1: key_parse_private_pem: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,password

Permission denied, please try again. debug1: read_passphrase: can't open /dev/tty: No such device or address debug1: Authentications that can continue: publickey,password Permission denied, please try again. debug1: read_passphrase: can't open /dev/tty: No such device or address debug1: Authentications that can continue: publickey,password debug1: No more authentication methods to try. Permission denied (publickey,password).

I am calling pscp with these parameters

pscp -r -v -l username -i /path/to/key/id_rsa_download2.ppk -P port C:\some\local\dir username@remoteserver:/remote/dir

And I am calling scp with these parameters

scp -r -v -i /path/to/key/id_rsa_download2.ppk -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -P port /some/local/dir username@remoteserver:/remote/dir

Can someone give me any hints where the problem is?

Edit When I try to call the scp command in command line, then scp asks me for a password, but the key should not ask me for a password.

2

A .ppk file is a Putty private key file, it's not an OpenSSH key file. See What difference between openssh key and putty key?

From the scp messages you posted:

debug1: Trying private key: /path/to/key/id_rsa_download2.ppk
debug1: key_parse_private2: missing begin marker
debug1: key_parse_private_pem: PEM_read_PrivateKey failed 

OpenSSH can't parse the key file you provided.

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.