In networks, users collaborate by sharing files with one another. In Windows networks, users simply allow sharing on their drive or some folders, and the files within them are available to the other users on the network. Windows networking also has the concept of a Domain which is a relatively stronger network in terms of security. In this, users must authenticate against a Domain Controller before they can gain access to the shared resources in that network.
Samba is the tool for allowing similar sharing by Linux machines in a Windows Workgroup/Domain environment. It can not only share directories on a Linux machine on a Windows network, but can also manage a Windows domain as its Domain Controller. Basically it has the ability to camouflage a Linux machine and make it appear to have a NetBIOS interface.
|
Samba gets automatically installed in the Workstation and Departmental Server installation types. To install Samba manually, just issue the following command in the terminal on PCQLinux 8.0 CD-1:
# rpm -ivh samba*.rpm
This installs samba-2.2.5-10.i386.rpm, samba-common-2.2.5-10.i386.rpm and smb-client-2.2.5-10.i386.rpm. This is for a Samba server install. If your Linux machine is to act as a client in a Windows Domain, then you need install only samba-common-2.2.5-10.i386.rpm and smb-client-2.2.5-10.i386.rpm. You can do this by issuing separate rpm
-ivh commands.
Configure Samba server with Webmin
Configuring your Samba server is very easy as compared to modifying the samba configuration file (smb.conf) manually. To start, open your web browser and launch Webmin. Select the Servers link and then click the “Samba Windows File Sharing” option. Click the “Windows Networking” icon which will then pop up a form in which you will find the option to fill in the NetBios name, Workgroup Name and the “Security Type” for this machine, which will act as the server. By default the Security type is set to “User Level”. Change all the fields according to your network and click on the “Save” button at the left bottom corner of the form.
Create New File Shares
To create a new share on this machine (a file or folder that is shared on the network), again go to “Samba Windows File Sharing“. Here you will find a link at the top: “Create a New File share”. Click on this link and it will take you to a form called “Create File Share” where you can fill the share name, the directory path to share and the access type to the shared directory.
After filling the fields just click the “Share” button at the left bottom of the form. Now, you need to start Samba to activate the share. For this, just click the “Start Samba Server” button at the bottom of the form. To start Samba from the command line, issue the following command:
#service smb start
Configuring Samba with SWAT
SWAT is another tool for configuring Samba. To install SWAT manually issue the following command from the PCQLinux 8.0 CD2:
# rpm -ivh samba-swat-2.2.5-10.i386.rpm
If you have installed samba during the install process itself, SWAT is also installed by default.
SWAT can be run over Webmin, or independently. To run SWAT without Webmin, you have to edit the /etc/services file and enter the following line:
swat 901/tcp
Now open your browser and go to http://localhost:901. You can replace localhost with the IP address of the server if you are configuring the setup from a remote machine. This will show you the SWAT configuration Form. Now click “GLOBALS” from the top bar and enter your Workgroup Name, NetBios name and Security (User Level, Share Level or Domain) and click the “Commit Changes” button. Now go to “SHARES” and click “Create Share”. This will open up a form in which you can fill in the parameters like share name, directory path and valid users. After filling all these fields click the “Commit Changes” button and your folder will be shared.
Samba Client
If your machine is going to connect as a client to a Windows work group, you need not install the full package, but just the client as described above. In order to connect to the workgroup, you need to issue the following commands from a terminal window:
#mount —t smbfs —o username=
It will now prompt you for the password, giving which will mount the share as required.
If you want to repeat this process frequently, then it is better to create a shell script out of this. To do this, open a text editor and type in the following
#mount —t smbfs —o username=
replacing all text within <> with their actual values.
Now save this file with executable rights. To give executable rights, right click on the saved file, select properties, go to the permissions tab and select the executable check box.
Now, double clicking on this file will mount the Windows share on your Linux machine.
Anindya Roy