Skip to content

Commit

Permalink
spread/lxd: restart sshd service instead of killing it
Browse files Browse the repository at this point in the history
  • Loading branch information
Meulengracht committed Jan 25, 2022
1 parent 5a72bb6 commit 058eb49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spread/lxd.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ func (p *lxdProvider) tuneSSH(name string) error {
cmds := [][]string{
{"sed", "-i", `s/^\s*#\?\s*\(PermitRootLogin\|PasswordAuthentication\)\>.*/\1 yes/`, "/etc/ssh/sshd_config"},
{"/bin/bash", "-c", fmt.Sprintf("echo root:'%s' | chpasswd", p.options.Password)},
{"killall", "-HUP", "sshd"},
{"service", "sshd", "restart"},
}
for _, args := range cmds {
output, err := exec.Command("lxc", append([]string{"exec", name, "--"}, args...)...).CombinedOutput()
Expand Down

0 comments on commit 058eb49

Please sign in to comment.