Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

smb: allow SPN (service principal name) to be configured

Nick Craig-Wood62a7765e57e3
diff --git a/backend/smb/connpool.go b/backend/smb/connpool.go
index 867c73201..7ac580390 100644
--- a/backend/smb/connpool.go
+++ b/backend/smb/connpool.go
@@ -34,9 +34,10 @@ func (f *Fs) dial(ctx context.Context, network, addr string) (*conn, error) {
d := &smb2.Dialer{
Initiator: &smb2.NTLMInitiator{
- User: f.opt.User,
- Password: pass,
- Domain: f.opt.Domain,
+ User: f.opt.User,
+ Password: pass,
+ Domain: f.opt.Domain,
+ TargetSPN: f.opt.SPN,
},
}
diff --git a/backend/smb/smb.go b/backend/smb/smb.go
index 688221ce4..e3fa0e666 100644
--- a/backend/smb/smb.go
+++ b/backend/smb/smb.go
@@ -60,6 +60,17 @@ func init() {
Name: "domain",
Help: "Domain name for NTLM authentication.",
Default: "WORKGROUP",
+ }, {
+ Name: "spn",
+ Help: `Service principal name.
+
+Rclone presents this name to the server. Some servers use this as further
+authentication, and it often needs to be set for clusters. For example:
+
+ cifs/remotehost:1020
+
+Leave blank if not sure.
+`,
}, {
Name: "idle_timeout",
Default: fs.Duration(60 * time.Second),
@@ -109,6 +120,7 @@ type Options struct {
User string `config:"user"`
Pass string `config:"pass"`
Domain string `config:"domain"`
+ SPN string `config:"spn"`
HideSpecial bool `config:"hide_special_share"`
CaseInsensitive bool `config:"case_insensitive"`
IdleTimeout fs.Duration `config:"idle_timeout"`