Tuesday, May 17, 2011

Samba Server


Samba includes a utility called SWAT, the Samba Web Administration Tool. This tool makes setting up Samba very easy. The main Samba configuration file is /etc/smb.conf. SWAT enables you to use a Web browser as the interface to /etc/smb.conf and makes the necessary modifications to this file. While you are using SWAT to make the configuration changes, you will learn more about the smb.conf file. A sample smb.conf file was created during the installation that can be used for reference. You should rename this file because you will create a new smb.conf using SWAT and it will overwrite the original file.
The smb.conf file is divided into several sections. Shown next is the smb.conf file from one of the computers on my home network.
# Samba config file created using SWAT
# from localhost (127.0.0.1)
# Date: 2000/05/25 10:29:40
# Global parameters
[global]
workgroup = ONE
netbios name = TERRY
server string = Samba Server
security = SHARE
log file = /var/log/samba/log
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = No
wins support = Yes
hosts allow = 192.168.1.
hosts deny = all
[homes]
comment = Home Directories
read only = No
[printers]
comment = All Printers
path = /var/spool/samba
guest ok = Yes
print ok = Yes
browseable = Yes
[sambashare]
path = /oldwin
valid users = naveen,ravi
read only = No
guest ok = no
browseable = yes
In the above file naveen and ravi are users  who can have access to /oldwin from the windows client. Start the services now to make file sharing on windows. sambashare is the share name.
service smb restart
You can test whether the smb process is running with the pgrep command:
# pgrep smb
Now create samba user and password for naveen and ravi.
# useradd naveen
#smbpasswd -a naveen
Now it will prompt for password,give the password
same for Ravi user too
Now give the following command to mount the samba server:
# smbmount ///share -u
Now at windows client side :
start – run- \\ipaddress\share name
Then you will get the remote desktop of the shared folders in linux.
This way samba can acess from windows.