summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-07-15 21:14:40 +0000
committerGitHub <noreply@github.com>2022-07-15 21:14:40 +0000
commitbbb7d4a9fb6049b1f805880f8aef9f3260987189 (patch)
treee7b552da7ed07c7229f10a070cf7411c1e02dd74 /pkg
parent98b22e29c9a769020de1ae8d2bf9a7630e930e78 (diff)
parent5f04f9961a6e18603d30b8b7aa415f9607d2f945 (diff)
downloadpodman-bbb7d4a9fb6049b1f805880f8aef9f3260987189.tar.gz
podman-bbb7d4a9fb6049b1f805880f8aef9f3260987189.tar.bz2
podman-bbb7d4a9fb6049b1f805880f8aef9f3260987189.zip
Merge pull request #14952 from ashley-cui/ssh
Machine init: create .ssh dir if not exist
Diffstat (limited to 'pkg')
-rw-r--r--pkg/machine/keys.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/machine/keys.go b/pkg/machine/keys.go
index 0c7d7114e..94cbdac04 100644
--- a/pkg/machine/keys.go
+++ b/pkg/machine/keys.go
@@ -21,6 +21,9 @@ var sshCommand = []string{"ssh-keygen", "-N", "", "-t", "ed25519", "-f"}
// CreateSSHKeys makes a priv and pub ssh key for interacting
// the a VM.
func CreateSSHKeys(writeLocation string) (string, error) {
+ if err := os.MkdirAll(filepath.Dir(writeLocation), 0700); err != nil {
+ return "", err
+ }
if err := generatekeys(writeLocation); err != nil {
return "", err
}