LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   automatic login by public key is not working (https://www.linuxquestions.org/questions/linux-general-1/automatic-login-by-public-key-is-not-working-4175431129/)

ghaedi591 10-08-2012 09:16 AM

automatic login by public key is not working
 
i tried to create public key as follow:
server1$ssh-keygen -t dsa
server1$ scp ~/.ssh/id_dsa.pub oracle@server2:.ssh/authorized_keys

server2$chmod 600 ~/.ssh/authorized_keys

but automatic login by public key is not working as follow:
server1$ ssh -vvv server2
..
debug3: Not a RSA1 key file /home/oracle/.ssh/id_dsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /home/oracle/.ssh/id_dsa type 2
debug1: loaded 3 keys
..
what is wrong!

lleb 10-08-2012 01:55 PM

your error is telling you what the problem is. you generated a dsa key and the login is expecting a rsa key. run your ssh-keygen again but this time do this:

Code:

ssh-keygen -t rsa -b 4096
this will generate a military grade rsa key.

then from your ~/.ssh/ directory you can use the following to get it to the second server:

Code:

ssh-copy-id -i id_rsa.pub ruser@rhost
then you should be able to ssh ruser@rhost without p/w prompt as long as both sides are configured properly.

jsaravana87 10-09-2012 12:39 AM

Hi,


Quote:

debug2: key_type_from_name: unknown key type '-----END'

Look after the below blog for configuration passwordless login between two server .

http://www.linuxquestions.org/questi...os-rhel-35029/

http://www.linuxquestions.org/questi...-keygen-35063/


All times are GMT -5. The time now is 03:10 PM.