Skip to content

Commit 0eee847

Browse files
authored
Merge pull request #127 from afbjorklund/ssh_authorized_keys
Look for ssh_authorized_keys without dashes
2 parents 5a09f68 + 8472c77 commit 0eee847

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lima-init.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ echo "${LIMA_CIDATA_USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/90-lima-users
3939
# Create authorized_keys
4040
LIMA_CIDATA_SSHDIR="${LIMA_CIDATA_HOMEDIR}"/.ssh
4141
mkdir -p -m 700 "${LIMA_CIDATA_SSHDIR}"
42-
awk '/ssh-authorized-keys/ {flag=1; next} /^ *$/ {flag=0} flag {sub(/^ +- /, ""); gsub(/^"|"$/,""); gsub("\\\\\"", "\""); print $0}' \
42+
# Lima currently uses "ssh-authorized-keys", which is invalid and should be "ssh_authorized_keys"
43+
awk '/ssh[-_]authorized[-_]keys/ {flag=1; next} /^ *$/ {flag=0} flag {sub(/^ +- /, ""); gsub(/^"|"$/,""); gsub("\\\\\"", "\""); print $0}' \
4344
"${LIMA_CIDATA_MNT}"/user-data >"${LIMA_CIDATA_SSHDIR}"/authorized_keys
4445
LIMA_CIDATA_GID=$(id -g "${LIMA_CIDATA_USER}")
4546
chown -R "${LIMA_CIDATA_UID}:${LIMA_CIDATA_GID}" "${LIMA_CIDATA_SSHDIR}"
@@ -127,7 +128,7 @@ fi
127128
LIMA_CA_CERTS=/usr/share/ca-certificates/lima-init-ca-certs.crt
128129
awk -f- "${LIMA_CIDATA_MNT}"/user-data <<'EOF' > ${LIMA_CA_CERTS}
129130
# Lima currently uses "ca-certs", which is deprecated and should be "ca_certs"
130-
/^ca.certs:/ {
131+
/^ca[-_]certs:/ {
131132
cacerts = 1
132133
next
133134
}

0 commit comments

Comments
 (0)