LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-07-2013, 08:45 AM   #1
esolve
LQ Newbie
 
Registered: Oct 2012
Posts: 18

Rep: Reputation: Disabled
scp file fail: Permission denied (publickey)


I want to trasfter a folder from a remote machine: 202.117.48.57 to local machine:202.118.45.65

when I ssh to the remote machine, I have to use a RSA passphrase, and I'm able to ssh into that machine, but if I use scp to copy files from that machine to local, I fail:
Code:
    [esolve@pkt comment]$ scp -v -r esolve@202.117.48.57:/home/lab/file_folder ./
        Executing: program /usr/bin/ssh host 202.117.48.5, user esolve, command scp -v -r -f -- /home/esolve/youtube/comments/fat
        OpenSSH_5.8p2, OpenSSL 1.0.0j-fips 10 May 2012
        debug1: Reading configuration data /etc/ssh/ssh_config
        debug1: Applying options for *
        debug1: Connecting to 202.117.48.5 [202.117.48.5] port 22.
        debug1: Connection established.
        debug1: identity file /user/esolve/home/.ssh/id_rsa type -1
        debug1: identity file /user/esolve/home/.ssh/id_rsa-cert type -1
        debug1: identity file /user/esolve/home/.ssh/id_dsa type -1
        debug1: identity file /user/esolve/home/.ssh/id_dsa-cert type -1
        debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1
        debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1 pat OpenSSH*
        debug1: Enabling compatibility mode for protocol 2.0
        debug1: Local version string SSH-2.0-OpenSSH_5.8
        debug1: SSH2_MSG_KEXINIT sent
        debug1: SSH2_MSG_KEXINIT received
        debug1: kex: server->client aes128-ctr hmac-md5 none
        debug1: kex: client->server aes128-ctr hmac-md5 none
        debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
        debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
        debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
        debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
        debug1: Server host key: RSA 4c:db:4f:80:ca:c4:9a:17:44:fc:1f:07:d3:f3:1e:d7
        debug1: Host '202.117.48.5' is known and matches the RSA host key.
        debug1: Found key in /user/esolve/home/.ssh/known_hosts:8
        debug1: ssh_rsa_verify: signature correct
        debug1: SSH2_MSG_NEWKEYS sent
        debug1: expecting SSH2_MSG_NEWKEYS
        debug1: SSH2_MSG_NEWKEYS received
        debug1: Roaming not allowed by server
        debug1: SSH2_MSG_SERVICE_REQUEST sent
        debug1: SSH2_MSG_SERVICE_ACCEPT received
        debug1: Authentications that can continue: publickey
        debug1: Next authentication method: publickey
        debug1: Trying private key: /user/esolve/home/.ssh/id_rsa
        debug1: key_parse_private_pem: PEM_read_PrivateKey failed
        debug1: read PEM private key done: type <unknown>
        Enter passphrase for key '/user/esolve/home/.ssh/id_rsa':
        debug1: read PEM private key done: type RSA
        debug1: Authentications that can continue: publickey
        debug1: Trying private key: /user/esolve/home/.ssh/id_dsa
        debug1: No more authentication methods to try.
        Permission denied (publickey).
I also use another way like below, still fail:
Code:
    root@lab:/home/lab# scp -r file_folder esolve@202.118.45.65:/home/local/
    ssh: connect to host 202.118.45.65 port 22: No route to host
    lost connection
what is wrong with this? thanks!
~
 
Old 01-07-2013, 09:13 AM   #2
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661

Rep: Reputation: 66
2nd option is saying either network or port in not reachable . Check network connectivity with ping and port connectivity with

telnet 202.118.45.65 22

from source machine.

Also ensure iptables and /etc/hosts.allow and/or hosts.deny have correct entries
 
Old 01-07-2013, 09:56 AM   #3
legolasthehansy
LQ Newbie
 
Registered: Dec 2006
Posts: 19

Rep: Reputation: 1
scp -v -r esolve@202.117.48.57:/home/lab/file_folder ./

Your keys might be wrong or you might not have set these up correctly

scp -r file_folder esolve@202.118.45.65:/home/local/

The expert above is right. No route to host.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH: Permission denied (publickey). clapclash Linux - Networking 6 10-19-2012 06:49 AM
[SOLVED] ssh killing me :( Permission denied (publickey) grail Linux - Newbie 10 07-06-2010 10:47 AM
ssh client say me Permission denied.(publickey). linderox Linux - Networking 2 02-27-2008 09:36 AM
Permission denied (publickey,password,keyboard-interactive) cccc Linux - General 3 05-31-2007 05:32 PM
Permission denied (publickey,password,keyboard-interactive). rockymaxsource Linux - Networking 3 04-27-2007 08:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration