fix: don't change authorized_keys if they are not defined
This commit is contained in:
parent
ad3ca0bdb5
commit
2ab852992f
@ -14,14 +14,16 @@ import (
|
|||||||
|
|
||||||
// Files writes the files from the given config
|
// Files writes the files from the given config
|
||||||
func Files(cfg *config.Config, log *dlog.Log) (err error) {
|
func Files(cfg *config.Config, log *dlog.Log) (err error) {
|
||||||
err = writeFile(
|
if cfg.RootUser.AuthorizedKeys != nil {
|
||||||
"/root/.ssh/authorized_keys",
|
err = writeFile(
|
||||||
[]byte(strings.Join(cfg.RootUser.AuthorizedKeys, "\n")),
|
"/root/.ssh/authorized_keys",
|
||||||
0600, 0700, cfg, log,
|
[]byte(strings.Join(cfg.RootUser.AuthorizedKeys, "\n")),
|
||||||
)
|
0600, 0700, cfg, log,
|
||||||
|
)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, file := range cfg.Files {
|
for _, file := range cfg.Files {
|
||||||
|
Loading…
Reference in New Issue
Block a user