LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-02-2015, 02:19 PM   #1
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Debian now only allows passwordless root login over SSH


During a dist-upgrade to Jessie the installer informed me that Debian recommended only passwordless root login over SSH. And the question asked was if I agreed to changing SSH so that only passwordless logins for root were allowed.

Now since years I disable any type of SSH root login on any Debian install.

Which is sometimes inconvenient. Mostly because it is hard to do some rsync copy or backup of files which are only accessible by root. My workaround is to temporarily enable root login on the destination, and initiate the rsync from the source.

My surprise is that Debian proposes to allow root login at all.

Is root login not a security risk, even when it is key based? Is it safe to do anyway?

jlinkels
 
Old 05-02-2015, 04:12 PM   #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 jlinkels View Post
Is root login not a security risk, even when it is key based?
Using pubkey auth only disables password guessing and requires you to possess both the private key and the pass phrase (deities smite those who use pass phrase-less keys).


Quote:
Originally Posted by jlinkels View Post
Is it safe to do anyway?
All SSH logins should be subject to common restrictions like "from=" declarations in ~/.ssh/authorized_keys, (to be deprecated) tcp_wrappers, PAM listfile, /etc/security/access.conf, firewall static white listing and reactive methods like fail2ban. Note using multiple layers is suggested.
 
Old 05-02-2015, 06:32 PM   #3
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
And your house should be a concrete bunker with reinforced doors, triple locks, bars on the windows and a team of armed guards patrolling the perimeter.

In the real world, some tradeoffs are made between practicality and security.
 
Old 05-02-2015, 10:09 PM   #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
Quote:
Originally Posted by descendant_command View Post
In the real world, some tradeoffs are made between practicality and security.
I know you can do better than that. So instead of stating the obvious show us your practical implementation.
 
Old 05-02-2015, 11:13 PM   #5
mattydee
Member
 
Registered: Dec 2006
Location: Vancouver, BC
Distribution: Debian,Ubuntu,Slackware
Posts: 479

Rep: Reputation: 48
How can you run (automated) scripts with passworded private keys though? Maybe this is what descendant_command took objection to.
 
Old 05-04-2015, 07:43 AM   #6
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Original Poster
Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Quote:
Originally Posted by unSpawn View Post
All SSH logins should be subject to common restrictions like "from=" declarations in ~/.ssh/authorized_keys, (to be deprecated) tcp_wrappers, PAM listfile, /etc/security/access.conf, firewall static white listing and reactive methods like fail2ban. Note using multiple layers is suggested.
So as I understand it, it is an additional security measure, but still not recommended.

jlinkels
 
Old 05-04-2015, 01:16 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Obviously denying root logins is best. But if you are forced to use root login then pubkey auth-only access provides good protection. I may SSH out of a machine as root user but that doesn't require the remote user to be root as well. And I never SSH in as root because there's nothing I transfer that I can't chown appropriately later on.
 
1 members found this post helpful.
Old 05-20-2015, 04:46 PM   #8
thumbelina
LQ Newbie
 
Registered: Oct 2006
Location: USA
Distribution: CentOS,Fedora,Ubuntu,Mint,Mageia,OPNsense
Posts: 17

Rep: Reputation: 8
another reason to deny remote SSH logins to the root account is to prevent the loss of accountability. The user who uses the remote SSH root login is not identified in the logs by his/her account credentials. But by requiring users to first remote login with their user credentials, and then accessing the root account via su or sudo, the logfiles maintain tracking of users both by access to a remote host and then by access to the root account.

Last edited by thumbelina; 05-20-2015 at 04:48 PM.
 
1 members found this post helpful.
  


Reply



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 Login - Bypass public Key check (temp disable passwordless login) Lunar Linux - Networking 1 02-23-2014 04:25 AM
Passwordless ssh works. Normal login/ssh Fails. gurunarayanan Linux - Newbie 9 11-08-2012 04:42 AM
Passwordless login in using ssh via non root user kenpachi Linux - Newbie 3 02-15-2010 10:37 AM
Passwordless SSH login triley Linux - General 3 11-14-2008 03:07 PM
Cannot set up passwordless login via ssh slinx Linux - Software 5 09-19-2008 09:37 AM

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

All times are GMT -5. The time now is 03:29 AM.

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