Commit 7688a81
committed
[BACKPORT 2025.1.2][PLAT-18631] Ssh broken through yugabyte user on onprem auto provisioning for RHEL 9
Summary:
Original diff: https://phorge.dev.yugabyte.com/D47122 (532a20f)
Selinux prevents accessing .ssh folder if the home is a non-standard location like /yb-user-home.
This change labels the path to allow access.
Test Plan:
Manually tested with the AMI ami-0d35d4245140392e8. Used to fail before this change.
```
LYYPVYV909:my-utilities nkhogen$ ssh -i /opt/yugaware/keys/ff4224f9-9fe7-43c3-8d70-9b16a9dcc708/yb-dev-aws.pem -ostricthostkeychecking=no -p 22 [email protected]
Register this system with Red Hat Insights: insights-client --register
Create an account or view all your systems at https://red.ht/insights-dashboard
Last login: Wed Oct 1 02:02:51 2025
[yugabyte@ip-10-9-77-220 ~]$ cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="9.4 (Plow)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="9.4"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Red Hat Enterprise Linux 9.4 (Plow)"
ANSI_COLOR="0;31"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:redhat:enterprise_linux:9::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 9"
REDHAT_BUGZILLA_PRODUCT_VERSION=9.4
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.4"
[yugabyte@ip-10-9-77-220 ~]$ echo $HOME
/yb-db-user
```
For the home path matching test:
1. Wrong home path
```
2025-10-02 10:43:33,300 INFO exec_command:ssh.py:443: Executing command /tmp/preflight_checks.sh --type provision --yb_home_dir /yb-db-user/fake-home --mount_points /mnt/d0 --ports_to_check 7000,7100,9000,9100,14000,18018,12000,9042,13000,5433,9300 --sudo_pass_file /tmp/.yb_sudo_pass.sh --tmp_dir /tmp --cleanup --install_node_exporter
{
"SSH Connection": true,
"Try Ansible Command": true,
"Home directory is clean": true,
"Home directory matches": false,
"Data directory is clean": true,
"Sudo Access to Python": true,
"Internet Connection": true,
"(Prometheus) No Pre-existing Node Exporter Running": true,
"(Prometheus) /opt/prometheus is writable": true,
"(Prometheus) /etc/prometheus is writable": true,
"(Prometheus) /var/log/prometheus is writable": true,
"(Prometheus) /var/run/prometheus is writable": true,
"(Prometheus) /var/lib/prometheus is writable": true,
"(Prometheus) /lib/systemd/system/node_exporter.service is writable": true,
"/opt/prometheus has free space of 100 MB ": true,
"/tmp has free space of 100 MB ": true,
"(PAM Limits) /etc/security/limits.conf is writable": true,
"NTP time synchronization set up": true,
"ntp_skew": true,
"(Mount Point) /mnt/d0 is writable": true,
"Port 7000 is available": true,
"Port 7100 is available": true,
"Port 9000 is available": true,
"Port 9100 is available": true,
"Port 14000 is available": true,
"Port 18018 is available": true,
"Port 12000 is available": true,
"Port 9042 is available": true,
"Port 13000 is available": true,
"Port 5433 is available": true,
"Port 9300 is available": true,
"Yugabyte User in Yugabyte Group": true,
"/yb-db-user/fake-home has free space of 2048 MB ": true,
"locale_present": true
}
```
2. Matching home path
```
2025-10-02 10:45:05,509 INFO exec_command:ssh.py:443: Executing command /tmp/preflight_checks.sh --type provision --yb_home_dir /yb-db-user --mount_points /mnt/d0 --ports_to_check 7000,7100,9000,9100,14000,18018,12000,9042,13000,5433,9300 --sudo_pass_file /tmp/.yb_sudo_pass.sh --tmp_dir /tmp --cleanup --install_node_exporter
{
"SSH Connection": true,
"Try Ansible Command": true,
"Home directory is clean": true,
"Home directory matches": true,
"Data directory is clean": true,
"Sudo Access to Python": true,
"Internet Connection": true,
"(Prometheus) No Pre-existing Node Exporter Running": true,
"(Prometheus) /opt/prometheus is writable": true,
"(Prometheus) /etc/prometheus is writable": true,
"(Prometheus) /var/log/prometheus is writable": true,
"(Prometheus) /var/run/prometheus is writable": true,
"(Prometheus) /var/lib/prometheus is writable": true,
"(Prometheus) /lib/systemd/system/node_exporter.service is writable": true,
"/opt/prometheus has free space of 100 MB ": true,
"/tmp has free space of 100 MB ": true,
"(PAM Limits) /etc/security/limits.conf is writable": true,
"NTP time synchronization set up": true,
"ntp_skew": true,
"(Mount Point) /mnt/d0 is writable": true,
"Port 7000 is available": true,
"Port 7100 is available": true,
"Port 9000 is available": true,
"Port 9100 is available": true,
"Port 14000 is available": true,
"Port 18018 is available": true,
"Port 12000 is available": true,
"Port 9042 is available": true,
"Port 13000 is available": true,
"Port 5433 is available": true,
"Port 9300 is available": true,
"Yugabyte User in Yugabyte Group": true,
"/yb-db-user has free space of 2048 MB ": true,
"locale_present": true
}
```
Reviewers: anijhawan, skhilar, nbhatia, vkumar, dshubin
Reviewed By: skhilar
Subscribers: yugaware, nikhil
Differential Revision: https://phorge.dev.yugabyte.com/D483551 parent 4e281a7 commit 7688a81
File tree
3 files changed
+63
-14
lines changed- managed
- devops/opscli/ybops/data
- node-agent/resources
- ynp/modules/provision/yugabyte/templates
3 files changed
+63
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | 152 | | |
156 | 153 | | |
157 | 154 | | |
| |||
176 | 173 | | |
177 | 174 | | |
178 | 175 | | |
179 | | - | |
| 176 | + | |
180 | 177 | | |
| 178 | + | |
| 179 | + | |
181 | 180 | | |
182 | 181 | | |
183 | 182 | | |
| |||
199 | 198 | | |
200 | 199 | | |
201 | 200 | | |
202 | | - | |
| 201 | + | |
203 | 202 | | |
204 | 203 | | |
205 | 204 | | |
| |||
213 | 212 | | |
214 | 213 | | |
215 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
216 | 237 | | |
217 | 238 | | |
218 | 239 | | |
| |||
393 | 414 | | |
394 | 415 | | |
395 | 416 | | |
| 417 | + | |
| 418 | + | |
396 | 419 | | |
397 | 420 | | |
398 | 421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
204 | 225 | | |
205 | 226 | | |
206 | 227 | | |
| |||
292 | 313 | | |
293 | 314 | | |
294 | 315 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 316 | + | |
| 317 | + | |
301 | 318 | | |
302 | 319 | | |
303 | 320 | | |
| |||
569 | 586 | | |
570 | 587 | | |
571 | 588 | | |
| 589 | + | |
| 590 | + | |
572 | 591 | | |
573 | 592 | | |
574 | 593 | | |
| |||
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
51 | | - | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
| |||
0 commit comments