On Sat, 13 Sep 2003, Net Llama! wrote:

> I've setup & used ssh public keys many times before.  All of a sudden, i 
> can't get it to work at all.  It works on the boxes where i've set it up in 
> the past, but new ones just fail to work.
> 
> The servers are all RH-7.3.  I thought that all that was required was:
> 0) on the client box, run "ssh-keygen -t dsa", hit enter at all the 
> prompts, and i'll end up with ~/.ssh/id_dsa.pub.
> 1) I then need to place the contents of that file on the server in 
> ~/.ssh/authorized_keys.
> 2) ssh to the server, and i shouldn't be prompted for a password.
> 
> this isn't happening.  i'm still prompted for a password.  am i missing 
> something obvious?


For me, most of the time these issues almost always are related to the 
permissions on the .ssh/authorized_keys file or the .ssh directory on the 
destination server.   For whatever reason "ssh -vvv"  is next to near 
impossible to decipher without being a ssh coder, wish there was more 
meaningful text in the output of that command.


Concerning the other poster's response to format inconsistency, I've had 
very little problem with that.  One exception though, when copying the 
public key to the .ssh/authorized_keys sometimes errant newlines get 
thrown in for good measure.


I don't remember if I've posted this to the list before, but the following 
is the slickest way I've seen to "forward" the ssh public key correctly to 
a remote host.  It's from a gent named Todd Jacobs who is very good at 
shell scripting.

From: Todd A. Jacobs <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: shell scripting <[EMAIL PROTECTED]>
Subject: SSH key add function

This isn't even worthy to be called a script, but it's a very easy way to 
add your ssh key to remote host in a single step. It's made my life quite 
a bit easier. :)

    # Takes a single argument: the name of the host to install the key
    # onto. Will do some rudimentary error-checking to verify that it's
    # been given a valid hostname.
    function putkey {
        [ $# -eq 1 ] || return 1
        { fgrep -q $1 /etc/hosts || host $1 > /dev/null; } || return 1
        cat $HOME/.ssh/id_dsa.pub | ssh $1 'cat >> .ssh/authorized_keys'
    }



I'm quite interested in your problem, Mr. Net Llama.  I've got the same 
issue going from any linux based host to a Cobalt RAQ and cannot get keys 
to work at all.
_______________________________________________
Linux-users mailing list
[EMAIL PROTECTED]
Unsubscribe/Suspend/Etc -> http://www.linux-sxs.org/mailman/listinfo/linux-users

Reply via email to