Guest User

Untitled

a guest
Jan 17th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. pw="raspberry"
  4.  
  5. apt install --force-yes samba
  6. apt install --force-yes samba-common-bin
  7.  
  8. (echo $pw; echo $pw ) | smbpasswd -s -a pi
  9.  
  10. echo "#======================= Global Settings =======================" > /etc/samba/smb.conf
  11. echo "[global]" >> /etc/samba/smb.conf
  12. echo "workgroup = WORKGROUP" >> /etc/samba/smb.conf
  13. echo "wide links = yes" >> /etc/samba/smb.conf
  14. echo "unix extensions = no" >> /etc/samba/smb.conf
  15.  
  16. echo "dns proxy = no" >> /etc/samba/smb.conf
  17.  
  18. echo "#### Debugging/Accounting ####" >> /etc/samba/smb.conf
  19. echo "log file = /var/log/samba/log.%m" >> /etc/samba/smb.conf
  20. echo "max log size = 1000" >> /etc/samba/smb.conf
  21. echo "syslog = 0" >> /etc/samba/smb.conf
  22. echo "panic action = /usr/share/samba/panic-action %d" >> /etc/samba/smb.conf
  23.  
  24. echo "####### Authentication #######" >> /etc/samba/smb.conf
  25. echo "security = user" >> /etc/samba/smb.conf
  26. echo "map to guest = Bad User" >> /etc/samba/smb.conf
  27. echo "guest account = pi" >> /etc/samba/smb.conf
  28.  
  29. echo "#======================= Share Definitions =======================" >> /etc/samba/smb.conf
  30.  
  31. echo "[root]" >> /etc/samba/smb.conf
  32. echo "comment = Admin Config Share" >> /etc/samba/smb.conf
  33. echo "path = /" >> /etc/samba/smb.conf
  34. echo "browseable = yes" >> /etc/samba/smb.conf
  35. echo "force user = root" >> /etc/samba/smb.conf
  36. echo "force group = root" >> /etc/samba/smb.conf
  37. echo "admin users = pi" >> /etc/samba/smb.conf
  38. echo "writeable = yes" >> /etc/samba/smb.conf
  39. echo "read only = no" >> /etc/samba/smb.conf
  40. echo "guest ok = yes" >> /etc/samba/smb.conf
  41. echo "create mask = 0777" >> /etc/samba/smb.conf
  42. echo "directory mask = 0777" >> /etc/samba/smb.conf
  43.  
  44. echo "#-------------------------------------------------------------------" >> /etc/samba/smb.conf
  45.  
  46. echo "[little-backup-box]" >> /etc/samba/smb.conf
  47. echo "comment = Little Backup Box /media/storage" >> /etc/samba/smb.conf
  48. echo "path = /media/storage" >> /etc/samba/smb.conf
  49. echo "browseable = yes" >> /etc/samba/smb.conf
  50. echo "force user = pi" >> /etc/samba/smb.conf
  51. echo "force group = pi" >> /etc/samba/smb.conf
  52. echo "admin users = pi" >> /etc/samba/smb.conf
  53. echo "writeable = yes" >> /etc/samba/smb.conf
  54. echo "read only = no" >> /etc/samba/smb.conf
  55. echo "guest ok = yes" >> /etc/samba/smb.conf
  56. echo "create mask = 0777" >> /etc/samba/smb.conf
  57. echo "directory mask = 0777" >> /etc/samba/smb.conf
  58.  
  59. sudo samba restart
Add Comment
Please, Sign In to add comment