Skip to content

Commit

Permalink
backends: LXD: fix SSH login for ubuntu-22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
thp-canonical committed Feb 26, 2024
1 parent ded9133 commit 3954505
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions spread/lxd.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ func (p *lxdProvider) serverJSON(name string) (*lxdServerJSON, error) {
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", `sed -i 's/^\s*#\?\s*\(PermitRootLogin\|PasswordAuthentication\)\>.*/\1 yes/' /etc/ssh/sshd_config.d/* || true`},
{"/bin/bash", "-c", fmt.Sprintf("echo root:'%s' | chpasswd", p.options.Password)},
{"killall", "-HUP", "sshd"},
}
Expand Down

0 comments on commit 3954505

Please sign in to comment.