Linux - How to transfer/copy files via a network connection using Samba between Linux and Windows
Table of Contents
1 - 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.
2 - Articles Related
3 - Installation and configuration Steps
3.1 - Install the Samba application
/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
3.2 - 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
3.3 - 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.
4 - Test the installation
4.1 - 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.
4.2 - From the linux platform
To test the installation, you use the smbclient application and you must give a UNC name.
[root@oel11g ~]# smbclient //localhost/homes Password: Domain=[OEL11G] OS=[Unix] Server=[Samba 3.0.33-3.7.el5] smb: \>
5 - Support
5.1 - perl(Convert::ASN1) is needed
[[email protected] 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 [[email protected] Server]# rpm -i perl-Convert-ASN1-0.20-1.1.noarch.rpm [[email protected] Server]# rpm -i samba-3.0.33-3.28.el5.x86_64.rpm