LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-24-2011, 09:09 AM   #1
angol
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Rep: Reputation: Disabled
RSA authentication in OpenSSH


Hello !!!!!

Tune the connection to ssh using public key, but somehow - it does not work on it to connect.
What I did:

1. Created a public and private key
2. Public copied to the authorized_keys file and transfer to the private car, which will connect
3. Transform our private key in the key supported Putty.
4. Then I go through Putty enter your login and instead, that would connect to a public key to enter the password login

Give you the config file ..... might be in it what - a mistake

Code:
#       $OpenBSD: sshd_config,v 1.81 2009/10/08 14:03:41 markus Exp $
 
# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.
 
# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin
 
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options change a
# default value.
 
 
Port 22
Protocol 2
 
# Ключ сервера для протокола версии 1
HostKey /etc/ssh/ssh_host_key
# Ключи rsa и dsa для ssh версии 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
 
KeyRegenerationInterval 3600
ServerKeyBits 1024
 
LoginGraceTime 600
PermitRootLogin yes
StrictModes yes
 
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
 
 
#RhostsAuthentication no
RhostsRSAAuthentication no
#IgnoreHosts yes
IgnoreRhosts yes
HostbasedAuthentication no
IgnoreUserKnownHosts no
UseLogin yes
PasswordAuthentication yes
PermitEmptyPasswords no
UsePAM yes
 
X11Forwarding no
#X11UseLocalhost yes
PrintMotd yes
PrintLastLog yes
#KeepAlive yes
MaxStartups 10
 
Subsystem sftp /usr/lib/ssh/sftp-server
 
Old 07-24-2011, 09:38 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
on the Linux side, the most common problem is permissions on the files. ~/.ssh should be set 700, and the authorized_keys file set as 600. These are explicitly checked by ssh by default and it will refuse to use them if not managed securely enough.
 
Old 07-24-2011, 09:50 AM   #3
angol
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
on the Linux side, the most common problem is permissions on the files. ~/.ssh should be set 700, and the authorized_keys file set as 600. These are explicitly checked by ssh by default and it will refuse to use them if not managed securely enough.
law established
chmod 600 authorized_keys
chmod 700 ~/.ssh/
but emerged a new error - Permission denied ()
 
Old 07-24-2011, 11:11 AM   #4
angol
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Has executed the following command ssh-v-i ~/.ssh/id_rsa 192.168.10.1

And here that has received

Code:

ssh -v -i ~/.ssh/id_rsa 192.168.10.1
OpenSSH_5.5p1, OpenSSL 1.0.0a-fips 1 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Applying options for *
debug1: Connecting to 192.168.10.1 [192.168.10.1] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5
debug1: match: OpenSSH_5.5 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.5
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.10.1' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/root/.ssh/id_rsa':
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/root/.ssh/id_rsa':
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).
 
Old 07-24-2011, 11:23 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you need to look at the server side logs, not the client.
 
  


Reply



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
ssh authentication with rsa razero Linux - Security 2 04-12-2010 04:24 AM
passphrase authentication fails using rsa with OpenSSH 5.1p1 (Slackware 12.2) sysfce2 Linux - Newbie 16 11-01-2009 08:21 PM
OpenSSH: password vs rsa authentication, different behaviour on Windows hintze Linux - General 2 07-15-2008 08:54 AM
How to RSA authentication ERBRMN Linux - Security 11 07-29-2005 11:22 AM
Sshd Rsa Authentication! Help! ryanstrayer Linux - General 0 01-23-2002 11:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:51 AM.

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
Open Source Consulting | Domain Registration