LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-29-2014, 09:35 AM   #16
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,027

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845

to debug i would run all the servers like:
sshd -d -d -d

and the clients like:
ssh -v -v -v

and round-robin test the connection from each system to each system (in this case, 9 instances) and compare the results to narrow down a possible culprit.
 
Old 07-29-2014, 09:50 AM   #17
unclesamcrazy
Member
 
Registered: May 2013
Posts: 187

Original Poster
Rep: Reputation: 1
Code:
# ssh -v 192.168.0.20 scp /root/.bashrc user1@192.168.0.99:/home/user1/Downloads
OpenSSH_5.3p1 Debian-3ubuntu7.1, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.0.20 [192.168.0.20] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu7.1
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: Host '192.168.0.20' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:4
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,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
Credentials cache file '/tmp/krb5cc_0' not found

debug1: Unspecified GSS failure.  Minor code may provide more information
Credentials cache file '/tmp/krb5cc_0' not found

debug1: Unspecified GSS failure.  Minor code may provide more information


debug1: Next authentication method: publickey
debug1: Offering public key: username@domain.com
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password
root@192.168.0.20's password: 
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_IN
debug1: Sending command: scp /root/.bashrc user1@192.168.0.99:/home/user1/Downloads
Host key verification failed.
lost connection
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 1840, received 2208 bytes, in 0.1 seconds
Bytes per second: sent 14088.1, received 16905.7
debug1: Exit status 1
 
Old 07-29-2014, 10:08 AM   #18
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
If you read the 16th line from bottom, it asks password to log into 192.168.0.20. You must have entered password here.
That's why it says
Quote:
debug1: Authentication succeeded (password).
it means you are logged into the 192.168.0.20 successfully.

Now if you read 9th line from the bottom, it tries to copy the file of 192.168.0.20 to 192.168.0.99 using scp command
Quote:
debug1: Sending command: scp /root/.bashrc user1@192.168.0.99:/home/user1/Downloads
But immediately it says
Quote:
Host key verification failed.
lost connection
It means you are not able to use scp on remote server.

I think you should use
Code:
ssh -t 192.168.0.20 scp /root/.bashrc user1@192.168.0.99:/home/user1/Downloads
to avoid this problem.

-t is Force pseudo-tty allocation. It is used to execute arbitrary screen-based programs on a remote machine.
 
Old 07-29-2014, 07:17 PM   #19
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
He can already go from A->B (192.168.0.20), but cannot go from B->C (192.168.0.99), because there are no keys provided by B that are accepted by C. It also looks like C is not configured for passwords (this can be confirmed by the above test).
 
Old 07-30-2014, 01:21 AM   #20
unclesamcrazy
Member
 
Registered: May 2013
Posts: 187

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by eklavya View Post
Code:
ssh -t 192.168.0.20 scp /root/.bashrc user1@192.168.0.99:/home/user1/Downloads
Now it worked somehow.
https://sites.google.com/site/uncles...mote_copy.mpeg
It solved my half problem. At least now I do not need to log into system B and run scp there. Otherwise everytime I used to clear history of system B. Now it can be done through my system.

But it would be good if I would be able to run scp on my system (not through ssh) just like it is working on centOS but I should not be greedy.
One day I will find the solution of this problem too.

Thank you all for your precious time and solutions...
 
Old 07-30-2014, 03:23 AM   #21
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
You DID log into system B. That is what the first ssh command DOES.

The only way to not use a password is to use credentials. And you have not set that up.
 
Old 08-06-2014, 09:32 AM   #22
unclesamcrazy
Member
 
Registered: May 2013
Posts: 187

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by jpollard View Post
You DID log into system B. That is what the first ssh command DOES.

The only way to not use a password is to use credentials. And you have not set that up.
Yes you are correct, it makes entries in .bash_history. The only advantage I am able to accomplish the task of file transfer between two servers in only single step. that's all and nothing else. Now what should I do.
 
Old 08-06-2014, 09:36 AM   #23
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,027

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
can you attach 9 different logs described in post #16. maybe then we can determine which key is not working between each client and server.
 
Old 08-06-2014, 09:59 AM   #24
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by unclesamcrazy View Post
Yes you are correct, it makes entries in .bash_history. The only advantage I am able to accomplish the task of file transfer between two servers in only single step. that's all and nothing else. Now what should I do.
You COULD use "scp -3 sourceip:file destinationip:file". From the scp manpage:
Code:
-3      Copies between two remote hosts are transferred through the local
        host.  Without this option the data is copied directly between
        the two remote hosts.  Note that this option disables the
        progress meter.
This way sourceip doesn't have to authenticate to "destinationip" (or vice versa). It is slower as each data packet from the source is sent to the local system, which then sends it to the destination. For small files this is not a problem. I wouldn't want to copy many MB or any GB sized files that way.

The advantage is avoiding to have to maintain an (n-1)-way set of keys on each remote host.

Last edited by jpollard; 08-06-2014 at 10:01 AM. Reason: typo
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Copying file to different system via crontab-called scp - 'No route to host' EnderX Linux - Networking 3 06-11-2012 08:11 AM
i wanted to send a file from one system to another system using SCP anurupr Linux - Networking 8 03-21-2010 09:22 AM
cannot upload data using scp, Read-only file system ufmale Linux - Newbie 3 08-27-2008 12:46 AM


All times are GMT -5. The time now is 12:58 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration