Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 63f6ec3

Browse files
authored
fix: use 0600 for private key in config-ssh (#235)
1 parent 1a85240 commit 63f6ec3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/cmd/configssh.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func configSSH(configpath *string, remove *bool) func(cmd *cobra.Command, _ []st
8181
if err != nil {
8282
return xerrors.Errorf("write to ssh config file %q: %s", *configpath, err)
8383
}
84+
_ = os.Remove(privateKeyFilepath)
8485

8586
return nil
8687
}
@@ -170,7 +171,7 @@ func writeSSHKey(ctx context.Context, client *coder.Client, privateKeyPath strin
170171
if err != nil {
171172
return err
172173
}
173-
return ioutil.WriteFile(privateKeyPath, []byte(key.PrivateKey), 0400)
174+
return ioutil.WriteFile(privateKeyPath, []byte(key.PrivateKey), 0600)
174175
}
175176

176177
func makeNewConfigs(userName string, envs []coderutil.EnvWithPool, privateKeyFilepath string) string {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy