Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-11-2012
Registered User
 
Join Date: Jan 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Problem with scp from one server to the other (but not vice versa)

Hi

I have a system PRIMARY where I can push or pull files to/from STANDBY using scp. I can also ssh without entering a password.

On the STANDBY system if I try and use scp or ssh it asks for a password.

I checked in ~/.ssh and there was no authorized_keys file on the PRIMARY server. After some googling (I can't post the URL I'm afraid) I have copied the public key (id_rsa.pub) on the STANDBY to a new file authorized_keys on the PRIMARY.

This hasn't worked though - still asking for the password.

What have I done wrong/am I missing?

If I look at the authorized_keys file on STANDBY I can see that it contains (amongst other entries) the public key from PRIMARY, so I assumed doing the opposite way round would now allow me to scp/ssh from the STANDBY to PRIMARY... but no joy.

I don't want to start regenerating key pairs etc as this is a Production system (this was already set up, all I have done is create the authorized_keys file on the PRIMARY).

Thanks!

Ross
Sponsored Links
    #2  
Old 01-11-2012
Mead Rotor
 
Join Date: Aug 2005
Location: Saskatchewan
Posts: 16,371
Thanks: 490
Thanked 2,534 Times in 2,417 Posts
It's picky about file permissions. try ssh-copy-id username@host instead of copying the file manually.

Also try scp -v -v to see what scp thinks it's doing.
Sponsored Links
    #3  
Old 01-12-2012
Registered User
 
Join Date: Jan 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Hi

Thanks... not sure what was meant by "try ssh-copy-id username@host instead of copying the file manually" ?

File permissions of authorized_keys look the same on both servers.

Used the -v option on scp and can see the differences:

STANDBY -> PRIMARY
debug1: Authentications that can continue: publickey,password,hostbased
debug1: Next authentication method: publickey
debug1: Offering public key: /oracle/S1P/102_64/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,hostbased
debug1: Trying private key: /oracle/S1P/102_64/.ssh/id_dsa
debug1: Next authentication method: password
-then requests password


PRIMARY -> STANDBY
debug1: Authentications that can continue: publickey,password,hostbased
debug1: Next authentication method: publickey
debug1: Offering public key: /oracle/S1P/102_64/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
-etc - carries on and works

So the difference is that it's not accepting the public key.

Does the public key have to be the same on both?? It's not... sure it doesn't need to be. As long as it's in authorized_keys it should work, right?

Cheers

Ross
Sponsored Links
Closed Thread

Tags
rsa, scp, ssh

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
What is the advantage of ubuntu over vista and vice versa? Anna Hussie Ubuntu 1 04-11-2011 04:23 PM
Uppercase to lowercase and vice versa jacky29 Shell Programming and Scripting 5 03-28-2011 04:33 AM
Appending from a file to a script and vice versa Jimmy_c UNIX for Dummies Questions & Answers 2 10-28-2010 10:33 AM
Pdf to text conversion and vice versa saltysumi Shell Programming and Scripting 2 10-30-2009 12:13 AM
sed help to convert from lowercase to uppercase and vice versa! salman4u Shell Programming and Scripting 6 03-21-2009 08:38 AM



All times are GMT -4. The time now is 06:18 PM.