v1.60

SMB

SMB is a communication protocol to share files over network.

This relies on go-smb2 library for communication with SMB protocol.

Paths are specified as remote:sharename (or remote: for the lsd command.) You may put subdirectories in too, e.g. remote:item/path/to/dir.

Notes

The first path segment must be the name of the share, which you entered when you started to share on Windows. On smbd, it’s the section title in smb.conf (usually in /etc/samba/) file. You can find shares by querying the root if you’re unsure (e.g. rclone lsd remote:).

You can’t access to the shared printers from rclone, obviously.

You can’t use Anonymous access for logging in. You have to use the guest user with an empty password instead. The rclone client tries to avoid 8.3 names when uploading files by encoding trailing spaces and periods. Alternatively, the local backend on Windows can access SMB servers using UNC paths, by \\server\share. This doesn’t apply to non-Windows OSes, such as Linux and macOS.

Configuration

Here is an example of making a SMB configuration.

First run

  1. rclone config

This will guide you through an interactive setup process.

  1. No remotes found, make a new one?
  2. n) New remote
  3. s) Set configuration password
  4. q) Quit config
  5. n/s/q> n
  6. name> remote
  7. Option Storage.
  8. Type of storage to configure.
  9. Choose a number from below, or type in your own value.
  10. XX / SMB / CIFS
  11. \ (smb)
  12. Storage> smb
  13. Option host.
  14. Samba hostname to connect to.
  15. E.g. "example.com".
  16. Enter a value.
  17. host> localhost
  18. Option user.
  19. Samba username.
  20. Enter a string value. Press Enter for the default (lesmi).
  21. user> guest
  22. Option port.
  23. Samba port number.
  24. Enter a signed integer. Press Enter for the default (445).
  25. port>
  26. Option pass.
  27. Samba password.
  28. Choose an alternative below. Press Enter for the default (n).
  29. y) Yes, type in my own password
  30. g) Generate random password
  31. n) No, leave this optional password blank (default)
  32. y/g/n> g
  33. Password strength in bits.
  34. 64 is just about memorable
  35. 128 is secure
  36. 1024 is the maximum
  37. Bits> 64
  38. Your password is: XXXX
  39. Use this password? Please note that an obscured version of this
  40. password (and not the password itself) will be stored under your
  41. configuration file, so keep this generated password in a safe place.
  42. y) Yes (default)
  43. n) No
  44. y/n> y
  45. Option domain.
  46. Domain name for NTLM authentication.
  47. Enter a string value. Press Enter for the default (WORKGROUP).
  48. domain>
  49. Edit advanced config?
  50. y) Yes
  51. n) No (default)
  52. y/n> n
  53. Configuration complete.
  54. Options:
  55. - type: samba
  56. - host: localhost
  57. - user: guest
  58. - pass: *** ENCRYPTED ***
  59. Keep this "remote" remote?
  60. y) Yes this is OK (default)
  61. e) Edit this remote
  62. d) Delete this remote
  63. y/e/d> d

Standard options

Here are the Standard options specific to smb (SMB / CIFS).

--smb-host

SMB server hostname to connect to.

E.g. “example.com”.

Properties:

  • Config: host
  • Env Var: RCLONE_SMB_HOST
  • Type: string
  • Required: true

--smb-user

SMB username.

Properties:

  • Config: user
  • Env Var: RCLONE_SMB_USER
  • Type: string
  • Default: “$USER”

--smb-port

SMB port number.

Properties:

  • Config: port
  • Env Var: RCLONE_SMB_PORT
  • Type: int
  • Default: 445

--smb-pass

SMB password.

NB Input to this must be obscured - see rclone obscure.

Properties:

  • Config: pass
  • Env Var: RCLONE_SMB_PASS
  • Type: string
  • Required: false

--smb-domain

Domain name for NTLM authentication.

Properties:

  • Config: domain
  • Env Var: RCLONE_SMB_DOMAIN
  • Type: string
  • Default: “WORKGROUP”

--smb-spn

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:

  1. cifs/remotehost:1020

Leave blank if not sure.

Properties:

  • Config: spn
  • Env Var: RCLONE_SMB_SPN
  • Type: string
  • Required: false

Advanced options

Here are the Advanced options specific to smb (SMB / CIFS).

--smb-idle-timeout

Max time before closing idle connections.

If no connections have been returned to the connection pool in the time given, rclone will empty the connection pool.

Set to 0 to keep connections indefinitely.

Properties:

  • Config: idle_timeout
  • Env Var: RCLONE_SMB_IDLE_TIMEOUT
  • Type: Duration
  • Default: 1m0s

--smb-hide-special-share

Hide special shares (e.g. print$) which users aren’t supposed to access.

Properties:

  • Config: hide_special_share
  • Env Var: RCLONE_SMB_HIDE_SPECIAL_SHARE
  • Type: bool
  • Default: true

--smb-case-insensitive

Whether the server is configured to be case-insensitive.

Always true on Windows shares.

Properties:

  • Config: case_insensitive
  • Env Var: RCLONE_SMB_CASE_INSENSITIVE
  • Type: bool
  • Default: true

--smb-encoding

The encoding for the backend.

See the encoding section in the overview for more info.

Properties:

  • Config: encoding
  • Env Var: RCLONE_SMB_ENCODING
  • Type: Encoding
  • Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot

--smb-description

Description of the remote.

Properties:

  • Config: description
  • Env Var: RCLONE_SMB_DESCRIPTION
  • Type: string
  • Required: false