Advertisement
shokti

centos 6.5 - install samba

Apr 28th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. install samba:
  2. yum install samba samba-client samba-common
  3.  
  4. check version:
  5. smbd --version
  6.  
  7. Configure the samba service to start automatically at boot time:
  8. chkconfig smb on
  9. chkconfig nmb on
  10.  
  11. Add and manage Samba users and groups:
  12. useradd -d /home/linuxuser -m linuxuser
  13. passwd linuxuser
  14. groupadd sambagrp
  15. usermod -a -G sambagrp linuxuser
  16. smbpasswd -a linuxuser
  17.  
  18. create share:
  19. mkdir /srv/securefiles
  20. mkdir /srv/shared
  21. chown -R linuxuser:sambagrp /srv/securefiles/
  22. chmod -R 770 /srv/securefiles/
  23. chown -R nobody:nobody /srv/shared/
  24. chmod -R 777 /srv/shared/
  25.  
  26. configure smb.conf file:
  27. nano /etc/samba/smb.conf
  28.  
  29. -------------------------------------------------------------------------------------
  30.  
  31. [global]
  32. security = share
  33.  
  34. [homes]
  35. comment = Home Directories
  36. browseable = no
  37. valid users = %S
  38. writable = yes
  39. create mask = 0755
  40. directory mask = 0755
  41.  
  42. [share]
  43. path = /srv/shared
  44. browsable =yes
  45. writable = yes
  46. guest ok = yes
  47. create mask = 0777
  48. directory mask = 0777
  49.  
  50. [secure]
  51. path = /srv/securefiles
  52. valid users = @sambagrp
  53. writable = yes
  54. browsable = yes
  55. create mask = 0770
  56. directory mask = 0770
  57.  
  58. -------------------------------------------------------------------------------------
  59.  
  60. add iptables rules:
  61. iptables -I INPUT 4 -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
  62. iptables -I INPUT 5 -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
  63. iptables -I INPUT 6 -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
  64. service iptables save
  65.  
  66. disable SELINUX:
  67. nano /etc/sysconfig/SELINUX
  68. -------------------------------------------------------------------------------------
  69. SELINUX=disabled
  70. -------------------------------------------------------------------------------------
  71.  
  72. restart service:
  73. service smb restart
  74. service nmb restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement