Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 41215 - Feature request: Install openssh with configuration file which by default sets PermitRootLogin no
Summary: Feature request: Install openssh with configuration file which by default set...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Security
URL:
Whiteboard:
Keywords:
: 42506 57348 66488 76363 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-02-11 01:38 UTC by Heiko Wundram
Modified: 2011-10-30 22:38 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
New build file which includes patch, unless allowrootlogin is set in USE flags. (openssh-3.7.1_p2-r3.ebuild,4.45 KB, text/plain)
2004-02-11 02:04 UTC, Heiko Wundram
no flags Details
Diff to openssh build directory to incorporate patch to distributed sshd_config (openssh-no-permitrootlogin.diff,362 bytes, text/x-diff)
2004-02-11 02:04 UTC, Heiko Wundram
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Wundram 2004-02-11 01:38:18 UTC
openssh on Gentoo is by default installed using PermitRootLogin yes, which is the default for the openssh server. This can be a serious problem, if people go handing out their root-passwords on IRC to have others fix problems for them, and are not aware of the dangers. I think it would be best to have this setting disabled globally, and to print an informative message after installation of openssh has completed, that the user must set it to on explicitly if he/she wishes to do so.

Most distributions I know (apart from Gentoo) come bundled with this set to no.

Reproducible: Always
Steps to Reproduce:
1. emerge openssh
2.
3.

Actual Results:  
/etc/ssh/sshd_config contains default lines: 
# PermitRootLogin yes 

Expected Results:  
IMO it should have installed with PermitRootLogin no
Comment 1 Heiko Wundram 2004-02-11 02:04:13 UTC
Created attachment 25388 [details]
New build file which includes patch, unless allowrootlogin is set in USE flags.
Comment 2 Heiko Wundram 2004-02-11 02:04:56 UTC
Created attachment 25389 [details]
Diff to openssh build directory to incorporate patch to distributed sshd_config
Comment 3 Heiko Wundram 2004-02-11 02:12:49 UTC
Additional feature request: Set Protocol 2 by default, so that protocol 1 logins are disallowed. This patch could come in a similar fashion as the one to which I have created the attachments.
Comment 4 Alexander Holler 2004-02-11 02:23:34 UTC
Instead of disable only the root account, I would prefer something like

AllowUsers foobar

This also prevents logins as on of the many system accounts (if one isn't created right).
Comment 5 Joshua Brindle (RETIRED) gentoo-dev 2004-02-11 03:04:47 UTC
I don't think this is a good idea at all. I often build machines remotely using ssh and I don't always add an account for myself (ie: they aren't my machines). If I can't ssh in after the install to finish setting up the machine I'm going to be pretty pissed off. If someone goes and tells their root password on irc and gets hacked then too bad, it isn't our responsibility. Furthermore, it's purely a preference issue and I'd wager that many more prefer it on than off.
Comment 6 Rajiv Aaron Manglani (RETIRED) gentoo-dev 2004-02-11 09:06:07 UTC
i agree with method that we should leave root access enabled. but i think we should consider what
is said in comment #3: protocol 2 only by default. discussion?

also, the gentoo security guide <http://www.gentoo.org/doc/en/gentoo-security.xml> shows a
sample sshd_config in code listing 11.3, which has root login turned off and protocol 2 only.
but there is no real explanation of what was changed from the default. some text should be added
to the doc to explain the changes. maybe also encourage users to read that doc at the end of the
install handbook.
Comment 7 Heiko Wundram 2004-02-11 09:10:42 UTC
I'd offer to write the text for the gentoo-security manual, if there is interest. I'd be very happy to make a great distribution even better, by giving, at least in writing, sensible defaults for most of the settings (tcp-wrappers, ssh, etc.). If there's interest, I'll write something up.
Comment 8 solar (RETIRED) gentoo-dev 2004-02-11 09:18:26 UTC
I have nothing valuable to add to this other than to say don't give out 
your root password over IRC (It's a plain text protocol!!)

I'll add the docs-team@ to this bug so they can see your interest in 
working on that document. Somebody there should be able to help
facilitate a commit of any diff's you may have to the existing xml
document.
Comment 9 SpanKY gentoo-dev 2004-02-11 17:08:11 UTC
i'd be for the disabling protocol 1 by default ... any qualms with that method ?
Comment 10 Joshua Brindle (RETIRED) gentoo-dev 2004-02-12 06:11:13 UTC
not at all.. ssh1 is old and has issues anyway, I'm not even sure under what circumstances one might need it (really old ssh clients on unsupported platforms?)

the security guide might also benefit with a blurb on the beauty of key based authentication (if it doesn't already have one).. That'd be nice to tell users about
Comment 11 SpanKY gentoo-dev 2004-02-12 07:12:50 UTC
added a dosed to enable this by default, thanks all
Comment 12 SpanKY gentoo-dev 2004-02-22 14:31:21 UTC
*** Bug 42506 has been marked as a duplicate of this bug. ***
Comment 13 SpanKY gentoo-dev 2004-07-17 16:57:14 UTC
*** Bug 57348 has been marked as a duplicate of this bug. ***
Comment 14 SpanKY gentoo-dev 2004-11-21 19:19:01 UTC
*** Bug 66488 has been marked as a duplicate of this bug. ***
Comment 15 Marius Mauch (RETIRED) gentoo-dev 2005-01-01 18:39:41 UTC
*** Bug 76363 has been marked as a duplicate of this bug. ***