mirror of
https://github.com/containers/podman.git
synced 2025-06-26 04:46:57 +08:00
Merge pull request #14952 from ashley-cui/ssh
Machine init: create .ssh dir if not exist
This commit is contained in:
@ -21,6 +21,9 @@ var sshCommand = []string{"ssh-keygen", "-N", "", "-t", "ed25519", "-f"}
|
|||||||
// CreateSSHKeys makes a priv and pub ssh key for interacting
|
// CreateSSHKeys makes a priv and pub ssh key for interacting
|
||||||
// the a VM.
|
// the a VM.
|
||||||
func CreateSSHKeys(writeLocation string) (string, error) {
|
func CreateSSHKeys(writeLocation string) (string, error) {
|
||||||
|
if err := os.MkdirAll(filepath.Dir(writeLocation), 0700); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
if err := generatekeys(writeLocation); err != nil {
|
if err := generatekeys(writeLocation); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user