Samba server is very important in file sharing, especially in networks, who that use different operating systems with Linux, especially for the Windows operating system. Unlike ftp protocol, samba protocol used for small-scale file sharing (Local Network).
Installation
Installation
For file sharing in linux, we use the samba server applications. which the stability was tested on the network between linux, or between linux - windows. type this command to install it :
# apt-get install samba
Samba Configuration Directory
Create a directory on a debian server, which will be shared in local networks. Then change the permissions on the directory using chmod. For example if you want writeable directory, use 777. Or a read-only directory, use 755.
# cd /home/(Your Username)/
# mkdir share
# chmod 777 share/ -R
For example :
# cd /home/anita-muy/
# mkdir share
# chmod 777 share/ -R
Creating a samba user
Add user to easily access files from local network sharing. This section is optional, if you use the Log In Anonymous mode, skip this section.
# useradd Guest
# smbpasswd –a Guest
User Authentication Login
Same with ftp, in samba server configuration, we can use the User Mode, or Guest Mode. The following configuration to made user and password. Edit smb.conf file as shown below.
# vim /etc/samba/smb.conf
####### Authentication #######
# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
security = user #edit it, and delete this “#”
#
#============ Share Definitions =============
[share] #add this after “Share Definitons”
path = /home/anita-muy/share/ #samba server directory
browseable = yes
writeable = yes
valid users = Guest #add your samba username
admin users = root
#. . .
Anonymous Login
Samba server can be used for file sharing with anonymous mode, if the security on the network are not needed. Then edit the smb.conf file as shown below.
# vim /etc/samba/smb.conf
####### Authentication #######
# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
security = user #edit it, and delete this “#”
#
#============ Share Definitions =============
[share] #add this after “Share Definitons”
path = /home/anita-muy/share/ #samba server directory
browseable = yes
writeable = yes # to read/write mode, if only read mode change to "no"
#. . .
Finally, to apply all configurations. Please restart the samba daemon.
# /etc/init.d/samba restart
No comments:
Post a Comment