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.

Articles Related

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

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)
  • Open the repository browser and tape an UNC address
  • Enter the credential of a user define above
  • And you must see the shared map.

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
  • Bookmark "Linux - How to transfer/copy files via a network connection using Samba between Linux and Windows" at del.icio.us
  • Bookmark "Linux - How to transfer/copy files via a network connection using Samba between Linux and Windows" at Digg
  • Bookmark "Linux - How to transfer/copy files via a network connection using Samba between Linux and Windows" at Ask
  • Bookmark "Linux - How to transfer/copy files via a network connection using Samba between Linux and Windows" at Google
  • Bookmark "Linux - How to transfer/copy files via a network connection using Samba between Linux and Windows" at StumbleUpon
  • Bookmark "Linux - How to transfer/copy files via a network connection using Samba between Linux and Windows" at Technorati
  • Bookmark "Linux - How to transfer/copy files via a network connection using Samba between Linux and Windows" at Live Bookmarks
  • Bookmark "Linux - How to transfer/copy files via a network connection using Samba between Linux and Windows" at Yahoo! Myweb
  • Bookmark "Linux - How to transfer/copy files via a network connection using Samba between Linux and Windows" at Facebook
  • Bookmark "Linux - How to transfer/copy files via a network connection using Samba between Linux and Windows" at Yahoo! Bookmarks
  • Bookmark "Linux - How to transfer/copy files via a network connection using Samba between Linux and Windows" at Twitter
  • Bookmark "Linux - How to transfer/copy files via a network connection using Samba between Linux and Windows" at myAOL
 
linux/samba.txt · Last modified: 2013/10/28 10:23 by gerardnico