UserCommands: add field CreateUserHome
This commit is contained in:
@@ -223,11 +223,8 @@ func (command *Command) RunCmd(cmdCtxLogger zerolog.Logger, opts *ConfigOpts) ([
|
||||
if err != nil {
|
||||
return collectOutput(&cmdOutBuf, command.Name, cmdCtxLogger, command.OutputToLog), fmt.Errorf("error creating file %s/authorized_keys: %v", userSshDir, err)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if err != nil {
|
||||
return collectOutput(&cmdOutBuf, command.Name, cmdCtxLogger, command.OutputToLog), fmt.Errorf("error opening file %s/authorized_keys: %v", userSshDir, err)
|
||||
}
|
||||
f, err = os.OpenFile(fmt.Sprintf("%s/authorized_keys", userSshDir), 0700, os.ModeAppend)
|
||||
if err != nil {
|
||||
return collectOutput(&cmdOutBuf, command.Name, cmdCtxLogger, command.OutputToLog), fmt.Errorf("error opening file %s/authorized_keys: %v", userSshDir, err)
|
||||
|
||||
@@ -115,6 +115,8 @@ type (
|
||||
|
||||
UserShell string `yaml:"userShell,omitempty"`
|
||||
|
||||
UserCreateHome bool `yaml:"userCreateHome,omitempty"`
|
||||
|
||||
SystemUser bool `yaml:"systemUser,omitempty"`
|
||||
|
||||
UserPassword string `yaml:"userPassword,omitempty"`
|
||||
|
||||
@@ -294,6 +294,7 @@ func getCommandTypeAndSetCommandInfo(command *Command) *Command {
|
||||
command.UserHome,
|
||||
command.UserShell,
|
||||
command.SystemUser,
|
||||
command.UserCreateHome,
|
||||
command.UserGroups,
|
||||
command.Args)
|
||||
case "modify":
|
||||
|
||||
Reference in New Issue
Block a user