From 84b5da089ee87738a34106971dd62d019f9fc474 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 7 Aug 2019 16:36:17 +0100 Subject: [PATCH] serve sftp: fix detection of whether server is authorized --- cmd/serve/sftp/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/serve/sftp/server.go b/cmd/serve/sftp/server.go index 6bf48d42b..ca507882e 100644 --- a/cmd/serve/sftp/server.go +++ b/cmd/serve/sftp/server.go @@ -130,8 +130,8 @@ func (s *server) serve() (err error) { fs.Logf(nil, "Loaded %d authorized keys from %q", len(authorizedKeysMap), authKeysFile) } - if !s.opt.NoAuth && len(authorizedKeysMap) == 0 && s.opt.User == "" && s.opt.Pass == "" { - return errors.New("no authorization found, use --user/--pass or --authorized-keys or --no-auth") + if !s.opt.NoAuth && len(authorizedKeysMap) == 0 && s.opt.User == "" && s.opt.Pass == "" && s.proxy == nil { + return errors.New("no authorization found, use --user/--pass or --authorized-keys or --no-auth or --auth-proxy") } // An SSH server is represented by a ServerConfig, which holds