Fix permissions of sshd private keys created by sshd-keygen script (#754779)

This commit is contained in:
Tomas Mraz 2011-11-18 09:26:19 +01:00
parent 17eb1038b2
commit 81da99ed9b
2 changed files with 4 additions and 3 deletions

View File

@ -784,6 +784,7 @@ fi
%changelog %changelog
* Fri Nov 18 2011 Tomas Mraz <tmraz@redhat.com> - 5.9p1-12 + 0.9.2-32 * Fri Nov 18 2011 Tomas Mraz <tmraz@redhat.com> - 5.9p1-12 + 0.9.2-32
- still support /etc/sysconfig/sshd loading in sshd service (#754732) - still support /etc/sysconfig/sshd loading in sshd service (#754732)
- fix incorrect key permissions generated by sshd-keygen script (#754779)
* Fri Oct 14 2011 Tomas Mraz <tmraz@redhat.com> - 5.9p1-11 + 0.9.2-32 * Fri Oct 14 2011 Tomas Mraz <tmraz@redhat.com> - 5.9p1-11 + 0.9.2-32
- remove unnecessary requires on initscripts - remove unnecessary requires on initscripts

View File

@ -23,7 +23,7 @@ do_rsa1_keygen() {
rm -f $RSA1_KEY rm -f $RSA1_KEY
if test ! -f $RSA1_KEY && $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then if test ! -f $RSA1_KEY && $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then
chgrp ssh_keys $RSA1_KEY chgrp ssh_keys $RSA1_KEY
chmod 640 $RSA1_KEY chmod 600 $RSA1_KEY
chmod 644 $RSA1_KEY.pub chmod 644 $RSA1_KEY.pub
if [ -x /sbin/restorecon ]; then if [ -x /sbin/restorecon ]; then
/sbin/restorecon $RSA1_KEY.pub /sbin/restorecon $RSA1_KEY.pub
@ -44,7 +44,7 @@ do_rsa_keygen() {
rm -f $RSA_KEY rm -f $RSA_KEY
if test ! -f $RSA_KEY && $KEYGEN -q -t rsa -f $RSA_KEY -C '' -N '' >&/dev/null; then if test ! -f $RSA_KEY && $KEYGEN -q -t rsa -f $RSA_KEY -C '' -N '' >&/dev/null; then
chgrp ssh_keys $RSA_KEY chgrp ssh_keys $RSA_KEY
chmod 640 $RSA_KEY chmod 600 $RSA_KEY
chmod 644 $RSA_KEY.pub chmod 644 $RSA_KEY.pub
if [ -x /sbin/restorecon ]; then if [ -x /sbin/restorecon ]; then
/sbin/restorecon $RSA_KEY.pub /sbin/restorecon $RSA_KEY.pub
@ -65,7 +65,7 @@ do_dsa_keygen() {
rm -f $DSA_KEY rm -f $DSA_KEY
if test ! -f $DSA_KEY && $KEYGEN -q -t dsa -f $DSA_KEY -C '' -N '' >&/dev/null; then if test ! -f $DSA_KEY && $KEYGEN -q -t dsa -f $DSA_KEY -C '' -N '' >&/dev/null; then
chgrp ssh_keys $DSA_KEY chgrp ssh_keys $DSA_KEY
chmod 640 $DSA_KEY chmod 600 $DSA_KEY
chmod 644 $DSA_KEY.pub chmod 644 $DSA_KEY.pub
if [ -x /sbin/restorecon ]; then if [ -x /sbin/restorecon ]; then
/sbin/restorecon $DSA_KEY.pub /sbin/restorecon $DSA_KEY.pub