Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- install samba:
- yum install samba samba-client samba-common
- check version:
- smbd --version
- Configure the samba service to start automatically at boot time:
- chkconfig smb on
- chkconfig nmb on
- Add and manage Samba users and groups:
- useradd -d /home/linuxuser -m linuxuser
- passwd linuxuser
- groupadd sambagrp
- usermod -a -G sambagrp linuxuser
- smbpasswd -a linuxuser
- create share:
- mkdir /srv/securefiles
- mkdir /srv/shared
- chown -R linuxuser:sambagrp /srv/securefiles/
- chmod -R 770 /srv/securefiles/
- chown -R nobody:nobody /srv/shared/
- chmod -R 777 /srv/shared/
- configure smb.conf file:
- nano /etc/samba/smb.conf
- -------------------------------------------------------------------------------------
- [global]
- security = share
- [homes]
- comment = Home Directories
- browseable = no
- valid users = %S
- writable = yes
- create mask = 0755
- directory mask = 0755
- [share]
- path = /srv/shared
- browsable =yes
- writable = yes
- guest ok = yes
- create mask = 0777
- directory mask = 0777
- [secure]
- path = /srv/securefiles
- valid users = @sambagrp
- writable = yes
- browsable = yes
- create mask = 0770
- directory mask = 0770
- -------------------------------------------------------------------------------------
- add iptables rules:
- iptables -I INPUT 4 -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
- iptables -I INPUT 5 -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
- iptables -I INPUT 6 -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
- service iptables save
- disable SELINUX:
- nano /etc/sysconfig/SELINUX
- -------------------------------------------------------------------------------------
- SELINUX=disabled
- -------------------------------------------------------------------------------------
- restart service:
- service smb restart
- service nmb restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement