Skip to content

Commit

Permalink
machine: Remove .ssh/authorized_keys workaround for MCO bug
Browse files Browse the repository at this point in the history
https://bugzilla.redhat.com/show_bug.cgi?id=1956739 was a MCO bug which was
mistakenly changing ~/.ssh/authorized_keys ownership to root.root. This bug was
fixed in OpenShift 4.10 so we no longer need to write as root to this file.
This will avoid the need for a workaround in podman bundle creation
which creates an empty ~/.ssh/authorized_keys with the right owner as
otherwise the file that gets created is owned by root.root.

This makes use of the newly introduced ssh.CopyData()

This is related to crc-org/snc@948ce966
  • Loading branch information
cfergeau authored and praveenkumar committed Jun 16, 2022
1 parent 33d028e commit 239a429
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/crc/machine/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,7 @@ func updateSSHKeyPair(sshRunner *crcssh.Runner) error {
}

logging.Info("Updating authorized keys...")
// CopyData uses sudo and we need to use it
// because of https://bugzilla.redhat.com/show_bug.cgi?id=1956739
err = sshRunner.CopyDataPrivileged(publicKey, "/home/core/.ssh/authorized_keys", 0644)
err = sshRunner.CopyData(publicKey, "/home/core/.ssh/authorized_keys", 0644)
if err != nil {
return err
}
Expand Down

0 comments on commit 239a429

Please sign in to comment.