Saturday, October 1, 2011

Installing Samba and Sharing files with windows

AIM

To install SAMBA(Server Message Block) in the linux system and share the files to windows OS.

INTRODUCTION

Samba allows file and print sharing between computers running Windows and computers running Unix. It is an implementation of dozens of services and a dozen protocols. Samba sets up network shares for chosen Unix directories (including all contained subdirectories). These appear to Microsoft Windows users as normal Windows folders accessible via the network. Integrating Fedora Linux into a Windows network is reasonable and easy as long as we use the SAMBA utilities.

First, we must allow the Linux server full rights and access to the Windows workgroup and local domain. That means that either in our Active Server environment we need to reserve an IP address for the Linux server, or we simply need to ensure a hard coded IP address is given to the Linux server.   The server must have a reserved IP address whether we deliver it via DHCP or statically assign it in the DNS. This also means that we need to ALLOW SMB DAEMON to operate. We can ensure our system security does this by editing our Firewall setup or using system-config-securitylevel.

Second, we must ensure that SAMBA (SAMBA tools and the SMB protocol) is installed and running on the Linux server.   Most versions of Fedora come with the necessary packages. We should also be sure to update our SAMBA security levels properly if we are having trouble accessing a shared directory. This is found under Samba Server Configuration tool, main menu Properties, option Server Settings, and then the tab: Security.

Now we are ready to configure our Fedora Linux/SAMBA machine (SAMBA Server).

PROCEDURE

1.    SMB(Server Message Block) is a protocol used by Microsoft family of OS for file and print sharing.

2.    Open the window terminal in linux and check whether SAMBA package is installed or not.
$rpm –qa|grepsamba

It will display the SAMBA packages installed in linux machine.

3.    Switch to supervisor$su(root) mode give the password. 

4.    Now check whether SAMBA service is started or not. By default it is running,else we have to start SAMBA services.
#service smb status
It displays SAMBA is stopped.

#service smb start
It will start the SAMBA service.

5.    Similarly check for NMB.
#service nmb status
#service nmb start

6.    Stop the IP table services.
#service ip tables stop
Similarly stop the IP version 6 table.
#service ip6tables stop

7.    Type getenforce   (disabled)
Type setenforce 0 set enforce: SE Linux is disabled.

8.    Now add,smbusername and password.

To add username Type
#useradd winuser
To give password, Type
#smbpasswd –a winuser
New SMB password: admin
Retype new SMB password: admin
Added user winuser.

9.    After adding SAMBA user, we have to restart the SAMBA service.

10.    Access the SAMBA server from windows. You are now ready to use the SAMBA server for your work.

11.    On the windows PC, click start menu and choose host name of SAMBA server and give the IP address of SAMBA server.

12.    If it works well, you can see a server login windows give the SAMBA username and password created in the precious steps.

13.    Now you can access the shared folders in the windows machine.


(Sample Screenshots)


No comments: