Bug 725414 - Targeted: add rule for ssh-keygen to be able to create .ssh folder with correct context
Targeted: add rule for ssh-keygen to be able to create .ssh folder with corre...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy (Show other bugs)
All Linux
high Severity high
: rc
: ---
Assigned To: Miroslav Grepl
Milos Malik
Depends On:
Blocks: RHEL62CCC 846801 846802
  Show dependency treegraph
Reported: 2011-07-25 08:15 EDT by Miroslav Vadkerti
Modified: 2012-10-15 09:58 EDT (History)
2 users (show)

See Also:
Fixed In Version: selinux-policy-3.7.19-106.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2011-12-06 05:09:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Miroslav Vadkerti 2011-07-25 08:15:17 EDT
Description of problem:
When running ssh-keygen as a non-root user (under unconfined_t) and the .ssh folder does not exist the tool creates .ssh folder with incorrect context. As all other tools from the ssh package create the .ssh folder with correct context the ssh-keygen tool should behave the same.

This custom module solves this issue:
policy_module(ssh-keygen, 1.1)
        type unconfined_t;
        role unconfined_r;
ssh_run_keygen(unconfined_t, unconfined_r)

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. login as non-root user
2. rm -rf ~/.ssh 
3. ssh-keygen
4. ls -dZ ~/.ssh
Actual results:
drwx------. test test unconfined_u:object_r:user_home_t:SystemLow .ssh/

Expected results:
drwx------. test test unconfined_u:object_r:ssh_home_t:SystemLow .ssh/

Additional info:
Test case for this scenario is a part of CCC testing.
Comment 2 Miroslav Grepl 2011-08-01 07:42:34 EDT
Fixed in selinux-policy-3.7.19-106.el6
Comment 9 errata-xmlrpc 2011-12-06 05:09:49 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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