Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


Search this Thread
Old 11-17-2006, 11:12 PM   #1
Registered: Feb 2002
Location: USA
Distribution: Fedora, CENTOS
Posts: 201

Rep: Reputation: 32
SSH allow public keys only


Is there a way to configure the SSH deamon to _only_ accept connetions via public keys? Meaning that if someone tries to SSH into a linux box and their computer doesn't have a valid key then they won't even get a login prompt?

I've not had any luck searching the forums for this one, and the sshd_config man page hasn't helped.

Old 11-17-2006, 11:18 PM   #2
Registered: May 2004
Posts: 552

Rep: Reputation: 31
This is from man sshd_config
Specifies whether password authentication is allowed. The default is "yes".
Old 11-18-2006, 08:25 AM   #3
Registered: May 2005
Posts: 36

Rep: Reputation: 15
well, i think what you need is SSH with Protocol 2...
Old 11-18-2006, 01:18 PM   #4
Senior Member
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
You need at least:
PasswordAuthentication no
UsePAM no
and possibly
ChallengeResponseAuthentication no
Your PAM configuration might allow password authentication even if you have it turned off with PasswordAuthentication no.

PS you should always turn off SSHv1:
Protocol 2
Old 11-18-2006, 03:34 PM   #5
Registered: Feb 2002
Location: USA
Distribution: Fedora, CENTOS
Posts: 201

Original Poster
Rep: Reputation: 32
Thanks chort. Your suggestions worked!

Now only users with a key are allowed to get in.



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
SSH public keys not working - RH 7.3 menator Linux - Newbie 7 11-03-2005 04:55 AM
ssh public/private keys lord_darkhelmet Linux - Newbie 8 10-29-2005 04:14 PM
SSH public / private keys problem guideweb Linux - Software 7 08-27-2005 10:49 PM
SSH Public Keys Problems Temujin_12 Linux - Security 4 02-23-2005 01:43 PM
Help with SSH and public/private keys stodge Linux - Security 5 05-14-2003 02:22 PM

All times are GMT -5. The time now is 05:20 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration