14.04 - Error when attempting to copy files w/ scp - Ask Ubuntu


i'm connecting ubunto instance, running apache/jmeter tests, , attempting use scp grab log files said tests.

i connect w/ following command:

ssh my-host.amazonaws.com -l my-username 

i'm able connect, , i'm able run tests. however, i've yet perform scp command without error.

i'm using following command:

scp my-username@my-machine-address.amazonaws.com:~/my-file-name.jtl ./ 

i following error:

permission denied (publickey). 

any idea issue be? have rights connect machine in first place. also, "my-username" username shared couple test users, , others able perform scp command without issue.

edit: here output attempting scp command w/ -v argument:

my-username@ip-xx-xx-xxx-xx:~$ scp -v      my-username@my-host.amazonaws.com:/home/ubuntu/jmeter.log ./ executing: program /usr/bin/ssh host my-host.amazonaws.com,      user ubuntu, command scp -v -f /home/ubuntu/jmeter.log openssh_6.6.1, openssl 1.0.1f 6 jan 2014 debug1: reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: applying options * debug1: connecting my-host.amazonaws.com [xx.xx.xxx.xx] port 22. debug1: connection established. debug1: identity file /home/ubuntu/.ssh/id_rsa type -1 debug1: identity file /home/ubuntu/.ssh/id_rsa-cert type -1 debug1: identity file /home/ubuntu/.ssh/id_dsa type -1 debug1: identity file /home/ubuntu/.ssh/id_dsa-cert type -1 debug1: identity file /home/ubuntu/.ssh/id_ecdsa type -1 debug1: identity file /home/ubuntu/.ssh/id_ecdsa-cert type -1 debug1: identity file /home/ubuntu/.ssh/id_ed25519 type -1 debug1: identity file /home/ubuntu/.ssh/id_ed25519-cert type -1 debug1: enabling compatibility mode protocol 2.0 debug1: local version string ssh-2.0-openssh_6.6.1p1 ubuntu-2ubuntu2.8 debug1: remote protocol version 2.0, remote software version      openssh_6.6.1p1     ubuntu-2ubuntu2.8 debug1: match: openssh_6.6.1p1 ubuntu-2ubuntu2.8 pat openssh_6.6.1*      compat 0x04000000 debug1: ssh2_msg_kexinit sent debug1: ssh2_msg_kexinit received debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none debug1: sending ssh2_msg_kex_ecdh_init debug1: expecting ssh2_msg_kex_ecdh_reply debug1: server host key: ecdsa     xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx debug1: host 'my-host.amazonaws.com' known , matches ecdsa host     key. debug1: found key in /home/ubuntu/.ssh/known_hosts:1 debug1: ssh_ecdsa_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 can continue: publickey debug1: next authentication method: publickey debug1: trying private key: /home/ubuntu/.ssh/id_xxx debug1: trying private key: /home/ubuntu/.ssh/id_yyy debug1: trying private key: /home/ubuntu/.ssh/id_abcde debug1: trying private key: /home/ubuntu/.ssh/id_zzzzzzz debug1: no more authentication methods try. permission denied (publickey). 

here verbose logging initial ssh connection:

$ ssh -v my-host.amazonaws.com -l ubuntu openssh_6.6.1, openssl 1.0.1i 6 aug 2014 debug1: reading configuration data /c/users/jdoe/.ssh/config debug1: connecting my-host.amazonaws.com [xx.xxx.xxx.xxx] port 22. debug1: connection established. debug1: identity file /c/users/jdoe/.ssh/id_rsa type 1 debug1: identity file /c/users/jdoe/.ssh/id_rsa-cert type -1 debug1: identity file /c/users/jdoe/.ssh/id_dsa type -1 debug1: identity file /c/users/jdoe/.ssh/id_dsa-cert type -1 debug1: identity file /c/users/jdoe/.ssh/id_ecdsa type -1 debug1: identity file /c/users/jdoe/.ssh/id_ecdsa-cert type -1 debug1: identity file /c/users/jdoe/.ssh/id_ed25519 type -1 debug1: identity file /c/users/jdoe/.ssh/id_ed25519-cert type -1 debug1: enabling compatibility mode protocol 2.0 debug1: local version string ssh-2.0-openssh_6.6.1 debug1: remote protocol version 2.0, remote software version openssh_6.6.1p1              ubuntu-2ubuntu2.8 debug1: match: openssh_6.6.1p1 ubuntu-2ubuntu2.8 pat openssh_6.6.1* compat 0x04000000 debug1: ssh2_msg_kexinit sent debug1: ssh2_msg_kexinit received debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none debug1: sending ssh2_msg_kex_ecdh_init debug1: expecting ssh2_msg_kex_ecdh_reply debug1: server host key: ecdsa     xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx debug1: host 'my-host.amazonaws.com' known , matches ecdsa host key. debug1: found key in /c/users/jdoe/.ssh/known_hosts:10 debug1: ssh_ecdsa_verify: signature correct debug1: ssh2_msg_newkeys sent debug1: expecting ssh2_msg_newkeys debug1: ssh2_msg_newkeys received debug1: roaming not allowed server debug1: ssh2_msg_service_request sent debug1: ssh2_msg_service_accept received debug1: authentications can continue: publickey debug1: next authentication method: publickey debug1: offering rsa public key: /c/users/jdoe/.ssh/id_rsa debug1: server accepts key: pkalg ssh-rsa blen 277 debug1: key_parse_private2: missing begin marker debug1: read pem private key done: type rsa debug1: authentication succeeded (publickey). authenticated my-host.amazonaws.com ([xx.xxx.xxx.xxx]:22). debug1: channel 0: new [client-session] debug1: requesting no-more-sessions@openssh.com debug1: entering interactive session. welcome ubuntu 14.04.5 lts (gnu/linux 3.13.0-95-generic x86_64) 

you not running both commands same machine or same user.

one output says /home/ubuntu/.ssh/id_rsa used, other says /c/users/jdoe/.ssh/id_rsa

so using wrong key in scp case, coming wrong directory.


Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User