LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

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

Rep: Reputation: 32
SSH allow public keys only


Hello.

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.

Thanks.
 
Old 11-17-2006, 10:18 PM   #2
randyding
Member
 
Registered: May 2004
Posts: 552

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

Rep: Reputation: 15
well, i think what you need is SSH with Protocol 2...
 
Old 11-18-2006, 12:18 PM   #4
chort
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:
Code:
PasswordAuthentication no
UsePAM no
and possibly
Code:
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:
Code:
Protocol 2
 
Old 11-18-2006, 02:34 PM   #5
GATTACA
Member
 
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.

Thanks!
 
  


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


All times are GMT -5. The time now is 08:52 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