| Summary: | ssh private key files should be not accessible by others | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Alex Jia <ajia> |
| Component: | openssh | Assignee: | Jan F. Chadima <jchadima> |
| Status: | CLOSED DUPLICATE | QA Contact: | BaseOS QE Security Team <qe-baseos-security> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 6.2 | CC: | esandeen, rwu |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-07-14 07:32:58 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Alex Jia
2011-07-13 06:29:09 UTC
Shouldn't this bug be filed against openssh(-server) rather than the kernel? And FWIW, the sshs initscript from openssh-server-5.3p1-20.el6.x86_64 does:
if [ ! -s $DSA_KEY ]; then
echo -n $"Generating SSH2 DSA host key: "
rm -f $DSA_KEY
if test ! -f $DSA_KEY && $KEYGEN -q -t dsa -f $DSA_KEY -C '' -N '' >&/dev/null; then
chmod 600 $DSA_KEY
chmod 644 $DSA_KEY.pub
if [ -x /sbin/restorecon ]; then
/sbin/restorecon $DSA_KEY.pub
fi
success $"DSA key generation"
echo
else
failure $"DSA key generation"
echo
exit 1
fi
fi
}
and similar for RSA; it looks like it explicitly does this chmod, so why is it showing up as og+r for you I wonder?
(In reply to comment #1) > Shouldn't this bug be filed against openssh(-server) rather than the kernel? Hi Eric, Yeah, I have changed component to openssh. Thanks, Alex (In reply to comment #2) > And FWIW, the sshs initscript from openssh-server-5.3p1-20.el6.x86_64 does: > > if [ ! -s $DSA_KEY ]; then > echo -n $"Generating SSH2 DSA host key: " > rm -f $DSA_KEY > if test ! -f $DSA_KEY && $KEYGEN -q -t dsa -f $DSA_KEY -C '' -N > '' >&/dev/null; then > chmod 600 $DSA_KEY I guess you haven't installed RHEL6.2-20110623.n.0/6/Server tree, it's okay for my rhel6.1 os, the above line is the same to you, however, for RHEL6.2-20110623.n.0 tree, my sshd initscript as follows: do_rsa1_keygen() { if [ ! -s $RSA1_KEY ]; then echo -n $"Generating SSH1 RSA host key: " rm -f $RSA1_KEY if test ! -f $RSA1_KEY && $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then chgrp ssh_keys $RSA1_KEY chmod 640 $RSA1_KEY chmod 644 $RSA1_KEY.pub if [ -x /sbin/restorecon ]; then /sbin/restorecon $RSA1_KEY.pub fi success $"RSA1 key generation" echo else failure $"RSA1 key generation" echo exit 1 fi fi } ...... Note, mode is 640 not 600. > > and similar for RSA; it looks like it explicitly does this chmod, so why is it > showing up as og+r for you I wonder? Please see the above sshd initscript, I haven't done any modification. Thanks for your nice comment, Alex *** This bug has been marked as a duplicate of bug 715326 *** |