From b59e712ea9904563c8e5df98efe2baa24b4726e6 Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Mon, 8 Aug 2022 20:56:38 +0800 Subject: [PATCH] fix: set custom umask in sftp sessions This matches the behaviour of the Lagoon ssh service. --- internal/sshserver/sessionhandler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/sshserver/sessionhandler.go b/internal/sshserver/sessionhandler.go index 416bead6..4659578c 100644 --- a/internal/sshserver/sessionhandler.go +++ b/internal/sshserver/sessionhandler.go @@ -42,7 +42,7 @@ func sessionHandler(log *zap.Logger, c *k8s.Client, sftp bool) ssh.Handler { // parse the command line arguments to extract any service or container args service, container, cmd := parseConnectionParams(s.Command()) if sftp { - cmd = []string{"sftp-server"} + cmd = []string{"sftp-server", "-u", "0002"} } // validate the service and container if err := k8s.ValidateLabelValue(service); err != nil {