Commit 97ff735
authored
Amend password and sshd logic to support Mariner OS (#156)
* Adding OS check to support other distros with different sshd configuration paths
* Altering update logic for Mariner -- rename causing linking device issue as file moves and it can't find it
* Refactor SSH configuration logic to dynamically select the appropriate configuration path based on filesystem structure and replace distro-specific file operations with universal temp file handling using copy/remove_file.
* Refactor update_sshd_config logic: eliminate temp files, simplify write process
Replaced tempfile-based logic with direct file operations for updating sshd_config.
The function now reads the file, updates or appends the necessary configuration,
and writes it back securely with appropriate permissions (0o600). This simplifies
the implementation and avoids potential cross-device issues with temporary files.
* Removing temp dependency
* Amending config line to make it clear the PasswordAuthentication was added by azure-init, and removing the file permissions settings
* Adding another added by azure-init comment and making sure file permissions line is deleted.1 parent a4fa057 commit 97ff735
3 files changed
+27
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
24 | 37 | | |
25 | 38 | | |
26 | 39 | | |
27 | | - | |
| 40 | + | |
28 | 41 | | |
29 | 42 | | |
30 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
220 | 219 | | |
221 | 220 | | |
222 | 221 | | |
223 | | - | |
| 222 | + | |
224 | 223 | | |
225 | 224 | | |
226 | 225 | | |
| |||
237 | 236 | | |
238 | 237 | | |
239 | 238 | | |
240 | | - | |
241 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
242 | 243 | | |
243 | | - | |
244 | | - | |
245 | | - | |
| 244 | + | |
246 | 245 | | |
247 | | - | |
248 | 246 | | |
249 | | - | |
250 | | - | |
251 | | - | |
| 247 | + | |
| 248 | + | |
252 | 249 | | |
253 | | - | |
254 | 250 | | |
255 | 251 | | |
256 | 252 | | |
257 | | - | |
| 253 | + | |
258 | 254 | | |
259 | 255 | | |
260 | 256 | | |
261 | | - | |
| 257 | + | |
| 258 | + | |
262 | 259 | | |
263 | 260 | | |
264 | 261 | | |
265 | | - | |
| 262 | + | |
266 | 263 | | |
267 | 264 | | |
268 | 265 | | |
| |||
0 commit comments