Bug 693420 - /dev/random inaccessible by ssh-keygen
Summary: /dev/random inaccessible by ssh-keygen
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.1
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Miroslav Vadkerti
Depends On:
Blocks: RHEL62CCC 846801 846802
TreeView+ depends on / blocked
Reported: 2011-04-04 15:36 UTC by Stephan Mueller
Modified: 2012-10-15 13:58 UTC (History)
6 users (show)

Fixed In Version: selinux-policy-3.7.19-81.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-05-19 12:27:31 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0526 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2011-05-19 09:37:41 UTC

Description Stephan Mueller 2011-04-04 15:36:59 UTC
Description of problem:

sshd does not start as the /etc/init.d/sshd ssh-keygen script is not able to access /dev/random for the host key generation. Note, in the evaluated configuration SSH_USE_STRONG_RNG is 1 which requires /dev/random.

ssh-keygen is not able to access /dev/random when run as user either. 

Version-Release number of selected component (if applicable):
RHEL6.1 ISO of Mar 30.

Expected results:
All OpenSSH applications must be able to access /dev/random.

Additional info:

A simple cat /dev/random works, so the policy most likely needs updating.

Comment 2 RHEL Product and Program Management 2011-04-04 15:43:21 UTC
Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 3 Daniel Walsh 2011-04-04 19:15:13 UTC

Are you seeing errors about anything other then ssh_keygen_t?

Comment 4 Stephan Mueller 2011-04-05 11:24:52 UTC
> Are you seeing errors about anything other then ssh_keygen_t?

I did not try anything else, but all OpenSSH applications (ssh, sshd, ssh-keygen) which have access to /dev/urandom must also be granted access to /dev/random as a THE central DRNG mechanism which is used by all the OpenSSH applications that need randomness can be switched from /dev/urandom to /dev/random.

Comment 5 Miroslav Vadkerti 2011-04-05 12:14:23 UTC
I can see problem with ssh also:

type=AVC msg=audit(1301987422.876:3827): avc:  denied  { getattr } for  pid=7359 comm="ssh" path="/dev/random" dev=devtmpfs ino=3687 scontext=staff_u:sysadm_r:ssh_t:s0-s15:c0.c1023 tcontext=system_u:object_r:random_device_t:s0 tclass=chr_file
type=AVC msg=audit(1301987562.162:3829): avc:  denied  { getattr } for  pid=7378 comm="ssh" path="/dev/random" dev=devtmpfs ino=3687 scontext=staff_u:sysadm_r:ssh_t:s0-s15:c0.c1023 tcontext=system_u:object_r:random_device_t:s0 tclass=chr_file

Comment 6 Daniel Walsh 2011-04-05 14:20:46 UTC
Miroslav Grepl, lets also add


Comment 7 Miroslav Grepl 2011-04-05 14:32:43 UTC
Yes, I added it.

Comment 10 Miroslav Grepl 2011-04-05 19:13:29 UTC
Fixed in selinux-policy-3.7.19-81.el6

Comment 12 Miroslav Vadkerti 2011-04-07 11:38:44 UTC
This seems to be fixed in selinux-policy-mls-3.7.19-82.el6

[root/sysadm_r/SystemLow@ibm-dx360m2-01 ~]# export SSH_USE_STRONG_RNG=1
[root/sysadm_r/SystemLow@ibm-dx360m2-01 ~]# ssh eal@localhost
Last login: Thu Apr  7 01:35:00 2011 from freedom.brq.redhat.com
[eal/staff_r/SystemLow@ibm-dx360m2-01 ~]$

[eal/staff_r/SystemLow@ibm-dx360m2-01 ~]$  export SSH_USE_STRONG_RNG=1
[eal/staff_r/SystemLow@ibm-dx360m2-01 ~]$ ssh-keygen 
Generating public/private rsa key pair.
Enter file in which to save the key (/home/eal/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/eal/.ssh/id_rsa.
Your public key has been saved in /home/eal/.ssh/id_rsa.pub.
The key fingerprint is:
70:e6:c9:fe:d1:06:22:8d:e0:40:e8:8b:f7:60:24:a9 eal@ibm-dx360m2-01.rhts.eng.bos.redhat.com
The key's randomart image is:
+--[ RSA 2048]----+
| ..              |
|..               |
|... . . o        |
|o..o . O .       |
|oo. . o S .      |
|E.+    o . o     |
| o o    . . o    |
|    .    . o     |
|          .      |

[root/sysadm_r/SystemLow@ibm-dx360m2-01 ~]# run_init service sshd restart
Authenticating eal.
Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]

Comment 14 errata-xmlrpc 2011-05-19 12:27:31 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.