Linux - How to transfer/copy files via a network connection using Samba between Linux and Windows

About Samba

Samba allows Linux computers to share files and printers across a network connection. By using its SMB protocol, your Linux box can appear in Windows Network Neighbourhood or My Network Places just like any other windows machine. You can share files this way, as well as printers.

Installation and configuration Steps

Install the Samba application

If you use Oracle Entreprise Linux 5 (of Red Hat, Cent), you will find the rpm installation package in the directory

/media/Entreprise Linux dvd 20090127

Samba Rpm Files

Install the 4 rpm files.

You may need to install a perl package before

Once the installation is done, you can test ii with this command : rpm -q samba

[root@oel11g ~]# rpm -q samba
samba-3.0.33-3.7.el5

The command give us the file and the version name if it's installed of otherwise :

package samba is not installed

Configuration of Samba

The configuration of Samba occur in the file /etc/samba/smb.conf. You can modify it manually or best by using the web-based swap interface.

Below my smb.conf file. You can find the documentation about the parameters in the original smb.conf file or in the documentation Samba-HOWTO-Collection.

# Samba config file created using SWAT
# from 127.0.0.1 (127.0.0.1)
# Date: 2009/10/15 13:29:18

[global]
	workgroup = MYGROUP
	server string = Samba Server Version %v
	passdb backend = tdbsam
	cups options = raw

[homes]
	comment = Home Directories
	read only = No

[printers]
	comment = All Printers
	path = /var/spool/samba
	read only = No
	guest ok = Yes
	printable = Yes
	browseable = No

[public]
	comment = Public Stuff
	path = /home/samba
	write list = +staff
	read only = No
	guest ok = Yes

How to add a user

A samba user must be a Linux user. To add it to samba, you do it by using the command smbpasswd as :

[root@oel11g ~]# smbpasswd -a root
New SMB password:
Retype new SMB password:
Added user root.

Test the installation

From the windows platform

  • Get the ip address of the linux system (with Linux - ifconfig (Interface Configuration))
  • Open the repository browser and tape an UNC address
  • Enter the credential of a user define above
  • And you must see the shared map.

Samba Homes Access

From the linux platform

To test the installation, you use the smbclient application and you must give a UNC name.

Example :

[root@oel11g ~]# smbclient //localhost/homes
Password: 
Domain=[OEL11G] OS=[Unix] Server=[Samba 3.0.33-3.7.el5]
smb: \> 

Support

perl(Convert::ASN1) is needed

[root@di-obia-01 Server]# rpm -i samba-3.0.33-3.28.el5.x86_64.rpm
error: Failed dependencies:
        perl(Convert::ASN1) is needed by samba-3.0.33-3.28.el5.x86_64
[root@di-obia-01 Server]# rpm -i perl-Convert-ASN1-0.20-1.1.noarch.rpm
[root@di-obia-01 Server]# rpm -i samba-3.0.33-3.28.el5.x86_64.rpm





Discover More
Map Of Internet 1973
File Transfer - Server Message Block (SMB) - Common Internet File System (CIFS)

SMB stands for Server Message Block and is also known as Common Internet File System (CIFS). It's the name for the communications protocol used by various operating systems produced by Microsoft over...
Linux Oel Connect To Server
Linux - How to transfer files between systems (such as Windows and Linux)

To transfer file from others system (such as windows) to a Linux server, you have several ways: the use of the file protocol ftp or sftp. (See winscp as software) with the help of Samba from OEL...
Linux - Installation

This article regroup all different installation of Linux.
Pam Auth Update
Linux - PAM (Pluggable Authentication Modules)

Pluggable Authentication Modules The Syntax of each rule is a space separated collection of tokens, the first three being...
Linux - Samba - How to mount/map a Windows Share on Linux

Often you use a central Windows repository to save your installation file. In order to make them available to Linux, you can mount a Windows Share instead of to copy them. If you want to “map a drive”...
Samba Swat Homepage
Linux - Samba - The Samba Web Administration Tool (swap)

SWAT is a web-based application that help to configure Samba. Swap is installed with the installation of samba. You can verify the installation by performing this command : swat -? swat answer...



Share this page:
Follow us:
Task Runner