LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 04-18-2009, 08:48 PM   #1
khurramch81
LQ Newbie
 
Registered: Jun 2008
Posts: 2

Rep: Reputation: 0
openssh server help required plz


I am trying to install openssh server with public key authentication on CentOS. But i am getting following error message:

Disconnected: No supported authentication method available
Server refused keys

my sshd_conf file is as follows:

Port 22
Protocol 2
AddressFamily inet
ListenAddress 172.20.14.162
LoginGraceTime 2m
PermitRootLogin no
MaxAuthTries 3
RSAAuthentication yes
PubkeyAuthentication yes
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
AuthorizedKeysFile ~/.ssh/authorized_keys
SyslogFacility AUTHPRIV
PasswordAuthentication no
ChallengeResponseAuthentication no
KerberosAuthentication no
GSSAPIAuthentication no
GSSAPICleanupCredentials yes
UsePAM no
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL
AllowGroups sshusers
MaxStartups 2
Banner /etc/ssh/banner
Subsystem sftp /usr/libexec/openssh/sftp-server


Please help me in this regard,

Kind regards,
Khurram
 
Old 04-18-2009, 09:11 PM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 207Reputation: 207Reputation: 207
Here is my functional sshd_config from a vanilla install of debian lenny, if it helps:
Quote:
Port 22
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes
 
Old 04-18-2009, 11:14 PM   #3
chadl
Member
 
Registered: Sep 2005
Location: US
Distribution: Gentoo AMD64 Testing
Posts: 129

Rep: Reputation: 16
If you run ssh with the -v switch, you will get more details on exactly what it is thinking when trying to connect to a server. For example, if it is skipping your public key because of permissions, it would tell you in the verbose messages.
For example
ssh -v chadl@void
will show a bunch of information on how the protocol is progressing. If the key is being accepted, you see something like (there is a ton more output, this is just a sampling):
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/chadl/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: Authentication succeeded (publickey).

In this case, the first line indicates that the client has a key to offer, and the server will (only) accept public keys for authentication. The method is selected, key is offered, and authentication finishes.

You will most likely see an error about why it is not using a public key (you did generate one, right?). Or, perhaps the issue is as simple as a mis-spelled or mis-permissioned ~/.ssh/authorized_keys file, so the server is not accepting the key, because it is not in there. In that case, the place to check is /var/log/secure on the server, and perhaps /var/log/messages.

Last edited by chadl; 04-18-2009 at 11:17 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
openssh server tunnel question officecase Linux - Security 2 05-08-2007 03:00 PM
squid error ....... plz help..urgently required shahg_shahg Linux - Wireless Networking 2 11-01-2005 03:07 AM
OpenSSH Server Depends DrWorm Linux - Software 0 07-17-2005 06:26 PM
openssh 3.7.1 server installation rockwell_001 Linux - Newbie 6 04-17-2005 03:39 PM
OpenSSH client to F Secure Server kmslack Linux - Security 1 03-18-2004 05:02 PM


All times are GMT -5. The time now is 02:55 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration