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 2099203 - Cannot perform ssh login using pubkey when poly-instantiation is enabled
Summary: Cannot perform ssh login using pubkey when poly-instantiation is enabled
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: pam
Version: 9.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Iker Pedrosa
QA Contact: sssd-qe
URL:
Whiteboard:
Depends On:
Blocks: 2091979
TreeView+ depends on / blocked
 
Reported: 2022-06-20 10:08 UTC by Renaud Métrich
Modified: 2022-09-14 07:59 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-13 21:29:50 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-125767 0 None None None 2022-06-20 14:22:53 UTC

Description Renaud Métrich 2022-06-20 10:08:39 UTC
Description of problem:

This is a sub-BZ of BZ #2091979

When poly-instantiation is enabled, users cannot login using a public key because at the time authenticating is performed, sshd reads "regular home dir for the user" (e.g. /home/user) instead of poly-instantiated one (e.g. /home/user/user.inst/unconfined_u...).

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

pam-1.5.1-9.el9.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Enable poly-instantiation for users and with poly-instantiated home directory (/etc/security/namespace.conf)

  Start pam_namespace.service unit to create the required temporary dirs.

2. Copy the pubkey to the user's home dir using "ssh-copy-id"

  $ ssh-copy-id user1@vm-poly9
  ...
  user1@vm-poly9's password: <passwd
  ...

3. Try connecting password-less

Actual results:

Password requested

Expected results:

No password requested

Additional info:

strace shows sshd reads /home/user1/.ssh/authorized_keys (which doesn't exist and is not accessible by the user anyway) instead of poly-instantiated one (/home/user1/user1.inst/unconfined_u\:object_r\:user_home_dir_t\:s0-s0\:c0.c1023_user1/.ssh/authorized_keys):

# strace -fttTvyy -s 128 -o /tmp/sshd.strace -p $(cat /run/sshd.pid)
strace: Process 705 attached
strace: Process 1286 attached
strace: Process 1287 attached
^C

# grep authorized_keys /tmp/sshd.strace 
1286  12:06:43.615529 openat(AT_FDCWD, "/home/user1/.ssh/authorized_keys", O_RDONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory) <0.000062>
1286  12:06:43.622310 openat(AT_FDCWD, "/home/user1/.ssh/authorized_keys", O_RDONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory) <0.000005>


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