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