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 07-05-2012
Registered User
 
Join Date: Jul 2012
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
SCP requests password despite common key

I created both a DSA and an RSA key for communication between two SSH servers. Each server has the same DSA and RSA key in their .ssh folders. Yet when copying files from one server to another using a client terminal, I get a password prompt. Why is that? What should I do to bypass the password prompt on each instance of scp?
Sponsored Links
    #2  
Old 07-05-2012
vbe's Avatar
vbe vbe is online now Forum Staff  
Moderator
 
Join Date: Sep 2005
Location: Switzerland - GE
Posts: 4,636
Thanks: 118
Thanked 256 Times in 245 Posts
How did you do that?
Sponsored Links
    #3  
Old 07-05-2012
vbe's Avatar
vbe vbe is online now Forum Staff  
Moderator
 
Join Date: Sep 2005
Location: Switzerland - GE
Posts: 4,636
Thanks: 118
Thanked 256 Times in 245 Posts
Lets say you did the job correctly,
Possible issues:
home directory must be 755!
I lost 2 days to find that...
same directory .ssh must be 700...
    #4  
Old 07-05-2012
Registered User
 
Join Date: Jul 2012
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Creating the key:
The following command was run on both servers and on the local client in separate terminals.
ssh-keygen -t dsa
I pressed enter three times to create the files .ssh/id_dsa and .ssh/id_dsa.pub. I then performed the following command on both servers.
scp .ssh/id_dsa.pub [user@hostname]:.
I entered my password for the scp command and copied the key from each server onto the other.
cat id_dsa.pub >> .ssh/authorized_keys
This installed the key on the servers.

Next, I copied the key from my local client onto both servers and installed them in the same way. Finally, I performed the following commands for each server on the local client:
scp [user@hostname]:.ssh/id_dsa.pub . ; cat id_dsa.pub >> authorized_keys
All machines are authorized to view and copy files on one another. The local client is able to share files between both servers with no password input. One server is able to copy files from the other with no password input. However, the second server is unable to copy files from the first without password input. And when I do enter the password, it breaks the operation.

EDIT: I'm a complete newbie. What do you mean by "must be 755" or "must be 700"?
Sponsored Links
    #5  
Old 07-05-2012
vbe's Avatar
vbe vbe is online now Forum Staff  
Moderator
 
Join Date: Sep 2005
Location: Switzerland - GE
Posts: 4,636
Thanks: 118
Thanked 256 Times in 245 Posts
File permission:

Code:
ant:/home/vbe $ ls -ld .
drwxr-xr-x  55 vbe        bin          30720 Jun 25 15:33 .
ant:/home/vbe $ ls -ld .ssh
drwx------   2 vbe        bin           1024 Jun 15 16:47 .ssh

Sponsored Links
    #6  
Old 07-05-2012
...@...
 
Join Date: Feb 2004
Location: NM
Posts: 9,658
Thanks: 164
Thanked 646 Times in 623 Posts
Pretend your login directory is: /home/snorton

Then
Code:
chmod 755 /home/snorton
cd /home/snorton
chmod 700 .ssh

This sets the file permissions on your home directory to 755 and the .ssh directory to 700.
Sponsored Links
    #7  
Old 07-05-2012
vbe's Avatar
vbe vbe is online now Forum Staff  
Moderator
 
Join Date: Sep 2005
Location: Switzerland - GE
Posts: 4,636
Thanks: 118
Thanked 256 Times in 245 Posts
If you got the idea, I wonder still if you did not overwrite one...
Start all again, but this time lets say you have local, server1 server2...
once keys are generated, copy your local fresh one for safety:

Code:
cp -p id_dsa.pub id_dsa.pub.mylocal

do the same for the others replacing local by server1 etc...
scp id_dsa.pub.mylocal to the other servers
Do the same on the other servers
Now you will have three (distinct) files to append to a freshly created authorized_keys...

--- ADDENDUM ---

Since Im not convinced Im very clear, have a look also here:
http://www.unix.com/emergency-unix-l...t-color-5.html
at post #30 of bakunin

Last edited by vbe; 07-05-2012 at 10:20 AM.. Reason: addendum
Sponsored Links
Closed Thread

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
Some I/O requests to this LV are waiting fretagi HP-UX 2 12-13-2011 09:52 AM
ip details for interface requests. digitalrg Solaris 2 05-24-2010 01:31 AM
Help- Change the password of users to common one Tuxidow Shell Programming and Scripting 0 06-11-2009 05:21 AM
udp sockets of dns requests not showing anywhere... angeloio UNIX for Advanced & Expert Users 0 11-11-2008 03:34 PM
Need to log http requests fundidor UNIX for Dummies Questions & Answers 3 08-08-2006 08:34 AM



All times are GMT -4. The time now is 03:54 AM.