Bug 2120843
| Summary: | openssh: ambient capabilities failed to applied to non-root user even when correct rules are in /etc/security/capability.conf | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Chris Cheney <ccheney> |
| Component: | openssh | Assignee: | Zoltan Fridrich <zfridric> |
| Status: | CLOSED WONTFIX | QA Contact: | Marek Havrila <mhavrila> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 8.6 | CC: | hartsjc, jjelen, mhavrila, zfridric |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-02-17 14:45:06 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Chris Cheney
2022-08-23 21:08:53 UTC
I will be closing this bug as "WONTFIX". The reason is that pam_cap module is not part of the standard PAM configuration for sshd, the module tries to surpass security measures of openssh and linux kernel and overall is not compatible with fundamental design of openssh. Therefore pam_cap module should not be considered compatible with openssh. To workaround this bug user can use su binary to su to himself to gain the capabilities after using ssh. One option would be to create a custom shell binary that would run shell, than self-su. Here is a simple workaround demo using su: 1. # useradd testuser 2. # passwd testuser 3. # sed -i '1i auth optional pam_cap.so keepcaps defer' /etc/pam.d/su 4. # echo '^cap_chown *' > /etc/security/capability.conf 5. # ssh -l testuser localhost 6. # su testuser 7. $ grep Cap /proc/$$/status CapInh: 0000000000000001 CapPrm: 0000000000000001 CapEff: 0000000000000001 CapBnd: 000001ffffffffff CapAmb: 0000000000000001 |