Skip to content

Commit 7a8259a

Browse files
committed
refact: moved code
1 parent a3d2ae0 commit 7a8259a

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎system/cuos/init.sh‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,12 @@ EOF
368368
}
369369

370370
set_root_password() {
371+
# Add ssh keys:
372+
mkdir -p /root/.ssh
373+
chmod 700 /root/.ssh
374+
jq -r '.["os_root_authorized_keys"][]?' "/system.json" >/root/.ssh/authorized_keys
375+
chmod 600 /root/.ssh/authorized_keys
376+
371377
local root_password
372378
root_password="$(jq_config -r '.os_root_password // empty')"
373379

@@ -388,12 +394,6 @@ set_root_password() {
388394

389395
usermod -U root
390396

391-
# Add ssh keys:
392-
mkdir -p /root/.ssh
393-
chmod 700 /root/.ssh
394-
jq -r '.["os_root_authorized_keys"][]?' "/system.json" >/root/.ssh/authorized_keys
395-
chmod 600 /root/.ssh/authorized_keys
396-
397397
report_info "cuos:init:root_access" "Root access is enabled"
398398
}
399399

0 commit comments

Comments
 (0)