Skip to content

Commit da18a10

Browse files
anjannathpraveenkumar
authored andcommitted
Make sure the authorized_keys in the vm has correct permissions
This is not necessarily needed in case of RHCOS but in case of fedora coreos the file's initial permissions are too open
1 parent a8cb334 commit da18a10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/crc/machine/machine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ func updateSSHKeyPair(sshRunner *crcssh.Runner) error {
713713
if err != nil {
714714
return err
715715
}
716-
cmd := fmt.Sprintf("echo '%s' > /home/core/.ssh/authorized_keys", publicKey)
716+
cmd := fmt.Sprintf("echo '%s' > /home/core/.ssh/authorized_keys; chmod 644 /home/core/.ssh/authorized_keys", publicKey)
717717
_, err = sshRunner.Run(cmd)
718718
if err != nil {
719719
return err

0 commit comments

Comments
 (0)