LinuxQuestions.org
Social Bookmarking all things Linux and Open Source
Go Back   LinuxQuestions.org > Forums > Linux > 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

Tags used in this thread
Popular LQ Tags ,

Reply
 
Thread Tools
Old 04-18-2009, 09:28 AM   #1
the_gripmaster
Member
 
Registered: Jul 2004
Location: Dhaka, Bangladesh
Distribution: openSUSE 11, RHEL 5.x, CentOS 5.x, OpenSolaris
Posts: 180
Thanked: 0
Question Key based authentication only for root for SSH


[Log in to get rid of this advertisement]
I disabled direct login of root by modifying /etc/ssh/sshd_config as follows:

PermitRootLogin no

This, however, disables direct root login for all authentication methods.Is there any parameter in the sshd_config file which I can change to allow direct login of root for only key-based authentication?

TIA.
the_gripmaster is offline  
Tag This Post ,
Reply With Quote
Old 04-18-2009, 11:01 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 16,718
Blog Entries: 30
Thanked: 285
Quote:
Originally Posted by the_gripmaster View Post
This, however, disables direct root login
...which is good...


Quote:
Originally Posted by the_gripmaster View Post
change to allow direct login of root
...which would be bad since you should not (want to) log in as root anyway.
unSpawn is offline     Reply With Quote
Old 04-18-2009, 11:09 AM   #3
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 1,551
Thanked: 76
Code:
man sshd_config
Quote:
PermitRootLogin
Specifies whether root can log in using ssh(1). The argument must be “yes”,
“without-password”, “forced-commands-only” or “no”. The default is “yes”.

If this option is set to “without-password” password authentication is disabled for
root.

If this option is set to “forced-commands-only” root login with public key authenti‐
cation will be allowed, but only if the command option has been specified (which may
be useful for taking remote backups even if root login is normally not allowed).
All other authentication methods are disabled for root.

If this option is set to “no” root is not allowed to log in.
AlucardZero is offline     Reply With Quote
Thanked by:
Old 04-18-2009, 11:12 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 16,718
Blog Entries: 30
Thanked: 285
Good one. I'll go read some more manual pages...
unSpawn is offline     Reply With Quote
Old 04-18-2009, 06:43 PM   #5
the_gripmaster
Member
 
Registered: Jul 2004
Location: Dhaka, Bangladesh
Distribution: openSUSE 11, RHEL 5.x, CentOS 5.x, OpenSolaris
Posts: 180
Thanked: 0

Original Poster
@AlucardZero

Thanks man.
the_gripmaster is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
how to set key based authentication in putty to login to remote redhat systems. anil.beni Linux - Newbie 1 11-28-2008 05:24 AM
Public key authentication with ssh elnacho12 Linux - Networking 3 12-18-2007 09:38 AM
Public Key Authentication with SSH edafe Ubuntu 1 08-26-2006 12:06 PM
Can't use public key authentication with SSH Noob69 Linux - General 5 01-06-2006 07:27 AM
ssh public key authentication teacup Linux - Networking 2 07-16-2004 10:30 PM


All times are GMT -5. The time now is 01:38 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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration