@@ -126,54 +126,54 @@ Use one of the following methods to configure the certificate on the the Unix/Li
126126### Method 2: Configure Certificate with Bash Script
1271271. Save the below bash script extract_scx_cert.sh
128128
129- ```console
130- #!/bin/bash
131-
132- # Usage: sudo ./extract_scx_cert.sh /path/to/certificate.pfx < pfx_password>
133-
134- PFX_FILE="$1"
135- PFX_PASS="$2"
136- SSL_DIR="/etc/opt/omi/ssl"
137- KEY_FILE="$SSL_DIR/omikey.pem"
138- CERT_FILE="$SSL_DIR/omi-host-$(hostname).pem"
139- SYMLINK_FILE="$SSL_DIR/omi.pem"
140-
141- if [[ -z "$PFX_FILE" || -z "$PFX_PASS" ]]; then
142- echo "Usage: $0 /path/to/certificate.pfx <pfx_password>"
143- exit 1
144- fi
145-
146- echo "🔐 Extracting private key..."
147- openssl pkcs12 -in "$PFX_FILE" -nocerts -out "$KEY_FILE" -nodes -passin pass:"$PFX_PASS"
148-
149- echo "📄 Extracting certificate..."
150- openssl pkcs12 -in "$PFX_FILE" -clcerts -nokeys -out "$CERT_FILE" -passin pass:"$PFX_PASS"
151-
152- echo "🔗 Creating symbolic link..."
153- rm -f "$SYMLINK_FILE"
154- ln -s "$CERT_FILE" "$SYMLINK_FILE"
155-
156- echo "🔧 Setting permissions..."
157- chmod 600 "$KEY_FILE"
158- chmod 640 "$CERT_FILE" "$SYMLINK_FILE"
159- chown root:omi "$CERT_FILE" "$SYMLINK_FILE"
160- chown omi:omi "$KEY_FILE"
161-
162- echo "🔄 Restarting omid service..."
163- systemctl restart omid
164- ```
129+ ```console
130+ #!/bin/bash
131+
132+ # Usage: sudo ./extract_scx_cert.sh /path/to/certificate.pfx <pfx_password>
133+
134+ PFX_FILE="$1"
135+ PFX_PASS="$2"
136+ SSL_DIR="/etc/opt/omi/ssl"
137+ KEY_FILE="$SSL_DIR/omikey.pem"
138+ CERT_FILE="$SSL_DIR/omi-host-$(hostname).pem"
139+ SYMLINK_FILE="$SSL_DIR/omi.pem"
140+
141+ if [[ -z "$PFX_FILE" || -z "$PFX_PASS" ]]; then
142+ echo "Usage: $0 /path/to/certificate.pfx <pfx_password>"
143+ exit 1
144+ fi
145+
146+ echo "🔐 Extracting private key..."
147+ openssl pkcs12 -in "$PFX_FILE" -nocerts -out "$KEY_FILE" -nodes -passin pass:"$PFX_PASS"
148+
149+ echo "📄 Extracting certificate..."
150+ openssl pkcs12 -in "$PFX_FILE" -clcerts -nokeys -out "$CERT_FILE" -passin pass:"$PFX_PASS"
151+
152+ echo "🔗 Creating symbolic link..."
153+ rm -f "$SYMLINK_FILE"
154+ ln -s "$CERT_FILE" "$SYMLINK_FILE"
155+
156+ echo "🔧 Setting permissions..."
157+ chmod 600 "$KEY_FILE"
158+ chmod 640 "$CERT_FILE" "$SYMLINK_FILE"
159+ chown root:omi "$CERT_FILE" "$SYMLINK_FILE"
160+ chown omi:omi "$KEY_FILE"
161+
162+ echo "🔄 Restarting omid service..."
163+ systemctl restart omid
164+ ```
165165
1661661. Change Script permissions to be executed
167167
168- ``` console
169- chmod +x /home/user/extract_scx_cert.sh
170- ```
168+ ```console
169+ chmod +x /home/user/extract_scx_cert.sh
170+ ```
171171
1721721. Execute the script with the parameters as below with the path to the pfx file and the password for it:
173173
174- ``` console
175- sudo ./extract_scx_cert.sh /path/to/certificate.pfx pfx_password
176- ```
174+ ```console
175+ sudo ./extract_scx_cert.sh /path/to/certificate.pfx pfx_password
176+ ```
177177
178178## Validate that the certificate is signed by the CA
179179
@@ -199,8 +199,7 @@ sudo ./extract_scx_cert.sh /path/to/certificate.pfx pfx_password
199199 notAfter=Jul 25 12:12:14 2033 GMT
200200 ```
201201
202- > [! NOTE]
203- > The path ` /etc/opt/microsoft/scx/ssl` contains a symbolic link ` scx.pem -> /etc/opt/omi/ssl/omi.pem` that is used by the SCX agent to use the OMI certificate that was created earlier.
202+ > The path `/etc/opt/microsoft/scx/ssl` contains a symbolic link `scx.pem -> /etc/opt/omi/ssl/omi.pem` that is used by the SCX agent to use the OMI certificate that was created earlier.
204203
2052041. Run a network trace on one of the management servers/gateways in the UNIX/Linux resource pool.
2062051. Run the following `WinRM` command against the agent and make sure you get the instance output:
0 commit comments