ssh: remove the ability to fully customize the software version

many clients rely on the version string to enable/disable some features.
We only allow to hide the version number, clients must be able to reliably
identify SFTPGo

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2024-04-20 17:15:15 +02:00
parent a38fd26cf6
commit ad7dcdb628
4 changed files with 12 additions and 8 deletions

View File

@@ -58,7 +58,6 @@ const (
var (
globalConf globalConfig
defaultSFTPDBanner = fmt.Sprintf("SFTPGo_%v", version.Get().Version)
defaultFTPDBanner = fmt.Sprintf("SFTPGo %v ready", version.Get().Version)
defaultInstallCodeHint = "Installation code"
defaultSFTPDBinding = sftpd.Binding{
@@ -255,7 +254,7 @@ func Init() {
SFTPD: sftpd.Configuration{
Bindings: []sftpd.Binding{defaultSFTPDBinding},
MaxAuthTries: 0,
Banner: defaultSFTPDBanner,
Banner: "",
HostKeys: []string{},
HostCertificates: []string{},
HostKeyAlgorithms: []string{},
@@ -761,9 +760,6 @@ func isExternalAuthScopeValid() bool {
}
func resetInvalidConfigs() {
if strings.TrimSpace(globalConf.SFTPD.Banner) == "" {
globalConf.SFTPD.Banner = defaultSFTPDBanner
}
if strings.TrimSpace(globalConf.FTPD.Banner) == "" {
globalConf.FTPD.Banner = defaultFTPDBanner
}