LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 04-18-2009, 08:28 AM   #1
the_gripmaster
Member
 
Registered: Jul 2004
Location: VIC, Australia
Distribution: RHEL, CentOS, Ubuntu Server, Ubuntu
Posts: 364

Rep: Reputation: 38
Question Key based authentication only for root for SSH


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.
 
Old 04-18-2009, 10:01 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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.
 
Old 04-18-2009, 10:09 AM   #3
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
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.
 
Old 04-18-2009, 10:12 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Good one. I'll go read some more manual pages...
 
Old 04-18-2009, 05:43 PM   #5
the_gripmaster
Member
 
Registered: Jul 2004
Location: VIC, Australia
Distribution: RHEL, CentOS, Ubuntu Server, Ubuntu
Posts: 364

Original Poster
Rep: Reputation: 38
@AlucardZero

Thanks man.
 
  


Reply

Tags
authentication, ssh



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:13 PM.

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