These are some guides for various use.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
2.1 KiB

7 months ago
  1. # Samba
  2. ## Setup Server
  3. ### Docker
  4. The official container and documentation was made by [dperson](https://hub.docker.com/r/samba).
  5. #### Volumes
  6. Set the following volumes with the -v tag.
  7. | Volume-Name | Container mount | Description |
  8. | ---------------- | --------------- | ------------------------------ |
  9. | samba\_nas | /nas | storage for samba data |
  10. | samba\_lib | /var/lib/samba | storage for samba lib |
  11. | samba\_cache | /var/cache/samba | storage for samba cache |
  12. | samba\_run | /run/samba | run entries for samba |
  13. | samba\_etc | /etc | etc directory of samba server |
  14. | samba\_log | /var/log/samba | storage for samba logs |
  15. #### Ports
  16. Set the following ports with the -p tag.
  17. | Container Port | Recommended outside port | Protocol | Description |
  18. | -------------- | ------------------------ | -------- | -------------- |
  19. | 139 | 139 | TCP | Samba internal |
  20. | 445 | 445 | TCP | Samba internal |
  21. #### Additional
  22. There are some special variables to set.
  23. | Flag | Usage |
  24. | --------------------------------------------------------------------- | ---------------- |
  25. | -u \<username;password\>(;ID;group;GID) | define user |
  26. | -w \<workgroup\> | define workgroup |
  27. | -s \<name;path\>(;browse;readonly;guest;users;admins;writelist;comment) | define shares |
  28. #### Rebuild
  29. ```
  30. #!/bin/sh
  31. docker stop samba
  32. docker rm samba
  33. docker pull dperson/samba
  34. docker run --name samba \
  35. --restart unless-stopped \
  36. -p 139:139 \
  37. -p 445:445 \
  38. -v samba_nas:/nas \
  39. -v samba_lib:/var/lib/samba \
  40. -v samba_cache:/var/cache/samba \
  41. -v samba_run:/run/samba \
  42. -v samba_etc:/etc \
  43. -v samba_log:/var/log/samba \
  44. -d dperson/samba -p \
  45. -u "user1;pass1" \
  46. -u "user2;pass2" \
  47. -s "public;/nas/public" \
  48. -s "user1private;/nas/user1;no;no;no;user1;user1" \
  49. -s "user2private;/nas/user2;no;no;no;user2;user2"
  50. ```