From 64f3bbb13bc71a45d7be4bd94a2d665ca045efe8 Mon Sep 17 00:00:00 2001 From: igophper <34326532+igophper@users.noreply.github.com> Date: Tue, 16 Jan 2024 21:10:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20sshd=5Fconfig=E5=85=BC=E5=AE=B9prohibit-?= =?UTF-8?q?password=20(#3609)=20(#3626)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/ssh.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/service/ssh.go b/backend/app/service/ssh.go index 303813b6a..f0f0cdc67 100644 --- a/backend/app/service/ssh.go +++ b/backend/app/service/ssh.go @@ -104,7 +104,7 @@ func (u *SSHService) GetSSHInfo() (*dto.SSHInfo, error) { data.PubkeyAuthentication = strings.ReplaceAll(line, "PubkeyAuthentication ", "") } if strings.HasPrefix(line, "PermitRootLogin ") { - data.PermitRootLogin = strings.ReplaceAll(line, "PermitRootLogin ", "") + data.PermitRootLogin = strings.ReplaceAll(strings.ReplaceAll(line, "PermitRootLogin ", ""), "prohibit-password", "without-password") } if strings.HasPrefix(line, "UseDNS ") { data.UseDNS = strings.ReplaceAll(line, "UseDNS ", "")