RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 693420 - /dev/random inaccessible by ssh-keygen
Summary: /dev/random inaccessible by ssh-keygen
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.1
Hardware: All
OS: Linux
urgent
high
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Miroslav Vadkerti
URL:
Whiteboard:
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:
Environment:
Last Closed: 2011-05-19 12:27:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0526 0 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 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
+dev_read_rand(ssh_keygen_t)


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

dev_read_rand(ssh_t)
dev_read_rand(ssh_keysign_t)

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

ssh:
[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 ~]$

ssh-keygen:
[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.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     |
|          .      |
+-----------------+

sshd:
[root/sysadm_r/SystemLow@ibm-dx360m2-01 ~]# run_init service sshd restart
Authenticating eal.
Password: 
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.

http://rhn.redhat.com/errata/RHBA-2011-0526.html


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