Skip to content

Commit 326b4d6

Browse files
committed
file mode fixed
1 parent 578e728 commit 326b4d6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ssh/ssh.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package ssh
33
import (
44
"github.com/jsmartx/giter/util"
55
"github.com/kevinburke/ssh_config"
6-
"os"
76
fs "io/ioutil"
7+
"os"
88
"path/filepath"
99
)
1010

util/util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func Keygen(publicPath, privatePath string, bits int) error {
2525
return err
2626
}
2727
// generate and write private key as PEM
28-
privateFile, err := os.Create(privatePath)
28+
privateFile, err := os.OpenFile(privatePath, os.O_RDWR|os.O_CREATE, 0600)
2929
defer privateFile.Close()
3030
if err != nil {
3131
return err
@@ -42,7 +42,7 @@ func Keygen(publicPath, privatePath string, bits int) error {
4242
if err != nil {
4343
return err
4444
}
45-
return fs.WriteFile(publicPath, ssh.MarshalAuthorizedKey(publicKey), 0755)
45+
return fs.WriteFile(publicPath, ssh.MarshalAuthorizedKey(publicKey), 0600)
4646
}
4747

4848
func JoinHostPort(host, port string) string {

0 commit comments

Comments
 (0)