ACC SHELL
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 34. Copying and Sharing Files</title><link rel="stylesheet" href="susebooks.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Documentation"><link rel="up" href="part.reference.mobility.html" title="Part VI. Mobility"><link rel="prev" href="cha.tablet.html" title="Chapter 33. Using Tablet PCs"><link rel="next" href="cha.adminhelp.html" title="Chapter 35. Help and Documentation"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header" border="0" class="bctable"><tr><td width="80%"><div class="breadcrumbs"><p><a href="index.html"> Documentation</a><span class="breadcrumbs-sep"> > </span><a href="book.opensuse.reference.html">Reference</a><span class="breadcrumbs-sep"> > </span><a href="part.reference.mobility.html">Mobility</a><span class="breadcrumbs-sep"> > </span><strong><a accesskey="p" title="Chapter 33. Using Tablet PCs" href="cha.tablet.html"><span>◀</span></a> </strong></p></div></td></tr></table></div><div class="chapter" title="Chapter 34. Copying and Sharing Files"><div class="titlepage"><div><div><h2 class="title"><a name="cha.filetrans"></a>Chapter 34. Copying and Sharing Files<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#cha.filetrans">¶</a></span></h2></div></div></div><div class="toc"><p><b>Contents</b></p><dl><dt><span class="sect1"><a href="cha.filetrans.html#sec.filetrans.scenarios">34.1. Scenarios</a></span></dt><dt><span class="sect1"><a href="cha.filetrans.html#sec.filetrans.accessmethod">34.2. Access Methods</a></span></dt><dt><span class="sect1"><a href="cha.filetrans.html#sec.filetrans.crossover">34.3. Accessing Files Using a Direct Connection</a></span></dt><dt><span class="sect1"><a href="cha.filetrans.html#sec.filetrans.winlincomp">34.4. Accessing Files on Different OS on the Same Computer</a></span></dt><dt><span class="sect1"><a href="cha.filetrans.html#sec.filetrans.copy">34.5. Copying Files between Linux Computers</a></span></dt><dt><span class="sect1"><a href="cha.filetrans.html#sec.filetrans.winssh">34.6. Copying Files between Linux and Windows Computers with SSH</a></span></dt><dt><span class="sect1"><a href="cha.filetrans.html#sec.filetrans.share">34.7. Sharing Files between Linux Computers</a></span></dt><dt><span class="sect1"><a href="cha.filetrans.html#sec.filetrans.linux2win">34.8. Sharing Files between Linux and Windows with Samba</a></span></dt><dt><span class="sect1"><a href="cha.filetrans.html#sec.filetransfer.moreinformation">34.9. For More Information</a></span></dt></dl></div><a class="indexterm" name="id508228"></a><a class="indexterm" name="id508235"></a><a class="indexterm" name="id508243"></a><a class="indexterm" name="id508250"></a><div class="abstract" title="Abstract"><p class="title"><b>Abstract</b></p><p>
If using multiple operating systems (OS) simultaneously, it is often
necessary to exchange files among them. Different systems may reside on
different partitions on the same machine or on different machines across
your network. There are various approaches to file exchange with
different basic instructions and possible pitfalls.
</p></div><div class="warning"><table border="0" cellpadding="3" cellspacing="0" width="100%" summary="Warning: Scenarios for Private Home Networks Only"><tr class="head"><td width="32"><img alt="[Warning]" src="admon/warning.png"></td><th align="left">Scenarios for Private Home Networks Only</th></tr><tr><td colspan="2" align="left" valign="top"><p>
Do not use the following scenarios in networks other than your own
private and trusted home network that is protected by a firewall.
Implementing high security measures for the configurations featured in
the following sections is beyond the scope of this document.
</p></td></tr></table></div><p>
Exchanging data may encompass either one of the following tasks:
</p><div class="variablelist"><dl><dt><span class="term">Copying</span></dt><dd><p>
To copy your data means to transfer your data from one system to the
other. This results in identical objects on both the source and the
target system.
</p><p>
Synchronizing data is a special way to copy data. If you change a file
on one computer, it is automatically changed on the other computer
after the synchronization. For example, think of a laptop that contains
your modified files and you want to have the same contents on your
desktop computer.
</p></dd><dt><span class="term">Sharing</span></dt><dd><p>
Sharing your files means establishing a client/server relationship. The
server provides files that can be accessed by the client. When changing
a file, you modify it on the server, not locally on the client. File
servers typically serve a large number of clients simultaneously.
</p></dd></dl></div><div class="sect1" title="34.1. Scenarios"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.filetrans.scenarios"></a>34.1. Scenarios<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetrans.scenarios">¶</a></span></h2></div></div></div><p>
The following list provides a number of possible scenarios involving file
transfer:
</p><div class="variablelist"><dl><dt><a name="vl.filetrans.scen1"></a><span class="term">Different OS on the Same Computer</span></dt><dd><p>
Many users have an operating system preinstalled by their vendor and
run Linux in a separate partition. Refer to
<a class="xref" href="cha.filetrans.html#sec.filetrans.winlincomp" title="34.4. Accessing Files on Different OS on the Same Computer">Section 34.4, “Accessing Files on Different OS on the Same Computer”</a> for more information.
</p></dd><dt><a name="vl.filetrans.scen2"></a><span class="term">Different Computers Not Connected by a Network</span></dt><dd><p>
Save the data to any media (CD, DVD, USB flash drive, or external hard
disk) and connect these to the target machine to copy your files. This
solution is inexpensive, intuitive, and straightforward. However, you
need the appropriate drives or ports on both computers. Additionally
the operating systems have to understand the filesystem.
</p><p>
Media are suited to occasional file transfers with limited file size.
If you need a more permanent solution, consider connecting them with a
network.
</p></dd><dt><a name="vl.filetrans.scen3"></a><span class="term">Different Computers Connected to the Same Network</span></dt><dd><p>
Set up a server of any kind on one computer, connect the server and
the client, and transfer the files from server to client. Choose from
various protocols available and pick the one that best matches your
needs and expertise.
</p><p>
The client/server setup requires more expertise and maintenance
efforts, but is better suited to routine transfer needs and exchange
with multiple systems. If you are looking for a permanent file
exchange, choose a client/server-based method. This method does not
impose any limits on the amount of data that can be transferred. See
<a class="xref" href="cha.filetrans.html#sec.filetrans.accessmethod" title="34.2. Access Methods">Section 34.2, “Access Methods”</a>.
</p></dd><dt><a name="vl.filetrans.scen4"></a><span class="term">Different Computers on Different Networks</span></dt><dd><p>
This scenario requires connection of different networks and is beyond
the scope of this document. Transfer files as if the computers were
not connected to a network.
</p></dd></dl></div></div><div class="sect1" title="34.2. Access Methods"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.filetrans.accessmethod"></a>34.2. Access Methods<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetrans.accessmethod">¶</a></span></h2></div></div></div><p>
The following methods and protocols are well-suited to file transfer and
sharing.
</p><div class="variablelist"><dl><dt><span class="term">FTP</span></dt><dd><p>
Use FTP (File Transfer Protocol) if you need to exchange files very
often and with different users. Set up an FTP server on one system and
access it with clients. There are many graphical client applications
available for FTP on Windows*, MacOS, and Linux. Depending on
how your FTP server is used, enable read and write permissions. See
<a class="xref" href="cha.filetrans.html#sec.filetrans.ftp" title="34.5.4. Copying Files with FTP">Section 34.5.4, “Copying Files with FTP”</a> for more details on FTP.
</p></dd><dt><span class="term">NFS</span></dt><dd><p>
NFS (Network File System) is a client/server system. A server exports
one or more directories that can be imported by a client. For more
information, see <a class="xref" href="cha.nfs.html" title="Chapter 26. Sharing File Systems with NFS">Chapter 26, <i>Sharing File Systems with NFS</i></a>.
</p><p>
Use NFS if you share files very often and for different users.
Generally, this protocol is more common in the Linux world than in the
Windows world. An NFS export integrates well into your Linux system
and you can browse the imported directory structure like any other
folder on your local machine. Depending on your configuration, enable
either read or write permissions or both on the server. In general,
for a home user it makes sense to allow read and write access.
</p></dd><dt><span class="term">rsync</span></dt><dd><p>
Use rsync to transfer regularly large volumes of data that does not
change considerably. It is available on Linux and Windows. A typical
use case for rsync is managing data backups. Refer to the manual page
of the <span class="command"><strong>rsync</strong></span> command and
<a class="xref" href="cha.filetrans.html#sec.filetrans.rsync" title="34.5.2. Transferring Files with rsync">Section 34.5.2, “Transferring Files with rsync”</a> for more information.
</p></dd><dt><span class="term">Unison</span></dt><dd><p>
Unison is an alternative to rsync. It is used to regularly synchronize
files between different computers but has the advantage to behave
bidirectionally. Refer to the manual page of the Unison command and
<a class="xref" href="cha.filetrans.html#sec.filetrans.unison" title="34.5.3. Transferring Files with Unison">Section 34.5.3, “Transferring Files with Unison”</a> for more information. Unison is
available on Linux and Windows.
</p></dd><dt><span class="term">CSync</span></dt><dd><p>
CSync is an alternative to Unison. Just like Unison it synchronizes
files bidirectionally. However, its architecture is modular so it can
be extended with plug-ins. See <a class="ulink" href="http://www.csync.org" target="_top">http://www.csync.org</a> for
more details.
</p></dd><dt><span class="term">SMB</span></dt><dd><p>
Samba is a client/server system and an implementation of the SMB
protocol. It is usually used in Windows networks, but is supported by
several operating systems. Refer to <a class="xref" href="cha.samba.html" title="Chapter 27. Samba">Chapter 27, <i>Samba</i></a> for
more information about Samba.
</p><p>
Use Samba if you need to share files very often and with different
users, especially to Windows systems. Samba as a Linux-only solution
is uncommon, use NFS instead. For more information about setting up a
Samba server, refer to <a class="xref" href="cha.filetrans.html#sec.filetrans.linux2win" title="34.8. Sharing Files between Linux and Windows with Samba">Section 34.8, “Sharing Files between Linux and Windows with Samba”</a>.
</p></dd><dt><span class="term">SSH</span></dt><dd><p>
SSH (Secure Shell) enables a secure connection between computer. The
SSH suite consists of several commands and uses public key encryption
to authenticate users. For more information, see
Chapter <i>SSH: Secure Network Operations</i> (↑Security Guide).
</p><p>
Use SSH if you copy files occasionally over an untrusted network and
if you are the only user doing so. Although there are graphical user
interfaces available, SSH is mainly considered a command line utility
and is available on Linux and Windows.
</p></dd></dl></div></div><div class="sect1" title="34.3. Accessing Files Using a Direct Connection"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.filetrans.crossover"></a>34.3. Accessing Files Using a Direct Connection<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetrans.crossover">¶</a></span></h2></div></div></div><p>
This section describes one way to exchange files between two computers
using an Ethernet crossover cable.
</p><p>
You need:
</p><div class="itemizedlist"><ul class="itemizedlist" type="bullet"><li class="listitem" style="list-style-type: disc"><p>
Ethernet crossover cable. For further information see:
<a class="ulink" href="http://en.wikipedia.org/wiki/Ethernet_crossover_cable" target="_top">http://en.wikipedia.org/wiki/Ethernet_crossover_cable</a>
</p></li><li class="listitem" style="list-style-type: disc"><p>
openSUSE on both computers
</p></li><li class="listitem" style="list-style-type: disc"><p>
An established connection. See Section “General Notes on File Sharing and Network Browsing” (Chapter 5, <i>Accessing Network Resources</i>, ↑KDE User Guide).
</p></li><li class="listitem" style="list-style-type: disc"><p>The SSH daemon running on both machines. To start the service,
run the command <span class="command"><strong>rcsshd start</strong></span> as <code class="systemitem">root</code>.</p></li></ul></div><p>
Proceed as follows:
</p><div class="procedure" title="Procedure 34.1. GNOME"><a name="id508734"></a><p class="title"><b>Procedure 34.1. GNOME</b></p><ol class="procedure" type="1"><li><p>
Start Nautilus.
</p></li><li><p>
Click on <span class="guimenu">File</span>+<span class="guimenu">Connect to
Server</span>.
</p></li><li><p>
Set the <span class="guimenu">Service Type</span> to <span class="guimenu">ssh</span>.
</p></li><li><p>
Enter the IP address and port of the remote computer (default is 22).
</p></li><li><p>
Specify the folder you want to open on the remote Computer.
</p></li><li><p>
Click <span class="guimenu">Connect</span>.
</p></li></ol></div><div class="procedure" title="Procedure 34.2. KDE"><a name="id508823"></a><p class="title"><b>Procedure 34.2. KDE</b></p><ol class="procedure" type="1"><li><p>
Start Dolphin.
</p></li><li><p>
Click on <span class="guimenu">Network</span>, <span class="guimenu">Add Network</span>.
Re-attach the pane if it is not available with <span class="guimenu">View</span>+<span class="guimenu">Panels</span>+<span class="guimenu">Places</span>.
</p></li><li><p>
Set the type of network to <span class="guimenu">Secure shell (ssh)</span>.
</p></li><li><p>
Enter any name and the correct user, IP address, port (default is 22)
and folder of the remote Computer. It is also possible to create an
icon for this connection by enabling the checkbox below. This
connection icon appears in the <span class="guimenu">Network</span> tab in
Dolphin.
</p></li><li><p>
Click on <span class="guimenu">Save & Connect</span> a dialog box opens and
requests the password.
</p></li></ol></div><p>
A new window containing the files of the remote computer will be opened.
</p></div><div class="sect1" title="34.4. Accessing Files on Different OS on the Same Computer"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.filetrans.winlincomp"></a>34.4. Accessing Files on Different OS on the Same Computer<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetrans.winlincomp">¶</a></span></h2></div></div></div><a class="indexterm" name="id508931"></a><a class="indexterm" name="id508942"></a><p>
New computers generally ship with a preinstalled operating system,
usually Windows. If you have installed Linux on a different partition,
you might want to exchange files between the different operating systems.
</p><p>
Windows cannot read Linux partitions by default. If you want to exchange
files between these two operating systems, you have to create an
<span class="quote">“<span class="quote">exchange partition</span>”</span>. For a more direct approach, see
<a class="ulink" href="http://www.fs-driver.org/" target="_top">http://www.fs-driver.org/</a> to get a driver supporting an
ext2 filesystem on Windows. The following file systems are used by
Windows and can be accessed from a Linux machine:
</p><div class="variablelist"><dl><dt><span class="term">FAT</span></dt><dd><p>
Various flavors of this file system are used by MS-DOS and Windows 95
and 98. You can create this type of file system with YaST. It is
possible to read and write files on FAT partitions from Linux. The
size of a FAT partition (and even the maximum size of a single file)
is subject to restrictions, depending on the FAT version. See
<a class="ulink" href="http://en.wikipedia.org/wiki/VFAT" target="_top">http://en.wikipedia.org/wiki/VFAT</a> for more information
about FAT file systems.
</p></dd><dt><span class="term">NTFS</span></dt><dd><p>
The NTFS file system is used by Windows NT, Windows 2000,
Windows XP, Windows Server 2003 and Windows Vista.
openSUSE includes write access support to the NTFS file system.
See <a class="ulink" href="http://en.opensuse.org/NTFS-3g" target="_top">http://en.opensuse.org/NTFS-3g</a> for more information
about NTFS-3g.
</p></dd></dl></div><p>
During the installation of openSUSE, your Windows partitions are
detected. After starting your Linux system, the Windows partitions
usually are mounted. These are possible ways of accessing your Windows
data:
</p><div class="variablelist"><dl><dt><span class="term">KDE</span></dt><dd><p>
Press <span class="keycap">Alt</span>+<span class="keycap">F2</span> and enter <code class="literal">sysinfo:/</code>. A new window opens
displaying the characteristics of your machine. <span class="guimenu">Disk
Information</span> lists your partitions. Look at those that are of
the file system type <code class="systemitem">ntfs</code>
or <code class="systemitem">vfat</code> and click these
entries. If the partition is not already mounted, KDE mounts the
partition now and displays the contents.
</p></dd><dt><span class="term">Command Line</span></dt><dd><p>
Just list the contents of <code class="filename">/windows</code> to see one or
more directories containing your Windows drives. The directory
<code class="filename">/windows/c</code> maps to the Windows
<code class="filename">C:\</code> drive, for example.
</p></dd></dl></div><div class="note"><table border="0" cellpadding="3" cellspacing="0" width="100%" summary="Note: Changing the Accessibility of Windows Partitions"><tr class="head"><td width="32"><img alt="[Note]" src="admon/note.png"></td><th align="left">Changing the Accessibility of Windows Partitions</th></tr><tr><td colspan="2" align="left" valign="top"><p>
Initially, Windows partitions are mounted read-only for normal users to
avoid accidental damage to the file system. To grant normal users full
access to a mounted Windows partition, change the mount behavior of this
Windows partition. Refer to the manual page of the
<span class="command"><strong>mount</strong></span> command for more information on mount options
for vfat and to the maual page of <code class="systemitem">ntfs-3g</code> on
mount options for NTFS.
</p></td></tr></table></div></div><div class="sect1" title="34.5. Copying Files between Linux Computers"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.filetrans.copy"></a>34.5. Copying Files between Linux Computers<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetrans.copy">¶</a></span></h2></div></div></div><p>
Linux offers a rich set of protocols you can use to copy files between
computers. Which protocol you use depends on how much effort you want to
invest and whether it needs to be compatible with future Windows
installations. The following sections feature various methods to transfer
files from and to Linux computers. Make sure that you have a working
network connection, because otherwise they will not work. All scenarios
rely on working name resolution in the network. If your network does not
include a name service, use IP addresses directly or add the IP addresses
along with respective hostnames to <code class="filename">/etc/hosts</code> on all
clients.
</p><p>
The following example IP addresses and hostnames are used across this
section:
</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td>
<p>
Target Hostname
</p>
</td><td>
<p>
<code class="systemitem">jupiter.example.com</code>
</p>
</td></tr><tr><td>
<p>
Target IP
</p>
</td><td>
<p>
<code class="systemitem">192.168.2.100</code>
</p>
</td></tr><tr><td>
<p>
Source Hostname
</p>
</td><td>
<p>
<code class="systemitem">venus.example.com</code>
</p>
</td></tr><tr><td>
<p>
Source IP
</p>
</td><td>
<p>
<code class="systemitem">192.168.2.101</code>
</p>
</td></tr><tr><td>
<p>
User
</p>
</td><td>
<p>
<code class="systemitem">tux</code>
</p>
</td></tr></tbody></table></div><div class="sect2" title="34.5.1. Copying Files with SSH"><div class="titlepage"><div><div><h3 class="title"><a name="sec.filetrans.ssh"></a>34.5.1. Copying Files with SSH<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetrans.ssh">¶</a></span></h3></div></div></div><a class="indexterm" name="id509306"></a><a class="indexterm" name="id509314"></a><a class="indexterm" name="id509323"></a><p>
The following requirements must be met on both computers that are
accessed via SSH:
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li><p>
If you use a hostname, make sure each hostname is listed in
<code class="filename">/etc/hosts</code> on both computers (see
<a class="xref" href="cha.basicnet.html#sec.basicnet.manconf.hosts" title="21.6.1.6. /etc/hosts">Section 21.6.1.6, “<code class="filename">/etc/hosts</code>”</a>.) If you use SSH with IP
addresses, you do not need to change anything.
</p></li><li><p>
If you use a firewall, open the SSH port. To do so, start YaST, and
select <span class="guimenu">Security and Users</span>+<span class="guimenu">Firewall</span>. Go to <span class="guimenu">Allowed
Services</span> and check whether <span class="guimenu">SSH</span> is
displayed as part of the list. If this is not the case, select SSH
from <span class="guimenu">Service to Allow</span> and click
<span class="guimenu">Add</span>. Apply your changes and leave YaST with
<span class="guimenu">Next</span> and <span class="guimenu">Finish</span>.
</p></li></ol></div><p>
To copy files from one computer to another, you need to know where the
files are located. For example, to copy the single file
<code class="filename">/srv/foo_file</code> from computer
<code class="systemitem">jupiter.example.com</code> to the current directory, use the
following <span class="command"><strong>scp</strong></span> command (the dot represents the current
directory as the copy target location):
</p><pre class="screen">scp tux@jupiter.example.com:/srv/foo_file .</pre><p>
To copy a whole directory structure, use the recursive mode of
<span class="command"><strong>scp</strong></span>:
</p><pre class="screen">scp -r tux@jupiter.example.com:/srv/foo_directory .</pre><p>
If your network does not provide name resolution, use the server's IP
address directly:
</p><pre class="screen">scp tux@192.168.2.100:/srv/foo_file .</pre><p>
If you do not know exactly where your files are, use the
<span class="command"><strong>sftp</strong></span> command. <a class="indexterm" name="id509447"></a> <a class="indexterm" name="id509458"></a> <a class="indexterm" name="id509469"></a> Copying files in KDE or GNOME with SFTP is very simple.
Proceed as follows:
</p><div class="procedure"><ol class="procedure" type="1"><li><p>
Press <span class="keycap">Alt</span>+<span class="keycap">F2</span>.
</p></li><li><p>
Enter the following at the address prompt (correct it to your own
values):
</p><pre class="screen">sftp://tux@jupiter.example.com</pre></li><li><p>
Confirm the question regarding of authenticity and enter the password
of <code class="literal">tux</code> on
<code class="systemitem">jupiter.example.com</code>.
</p></li><li><p>
Drag and drop the desired files or directories to your desktop or a
local directory.
</p></li></ol></div><p>
KDE provides another protocol called <code class="literal">fish</code> that can be
used if <code class="literal">sftp</code> is not available. The use of this
protocol is similar to <code class="literal">sftp</code>. Just replace the
<code class="literal">sftp</code> protocol prefix of the URL with
<code class="literal">fish</code>:
</p><pre class="screen">fish://tux@jupiter.example.com</pre></div><div class="sect2" title="34.5.2. Transferring Files with rsync"><div class="titlepage"><div><div><h3 class="title"><a name="sec.filetrans.rsync"></a>34.5.2. Transferring Files with rsync<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetrans.rsync">¶</a></span></h3></div></div></div><a class="indexterm" name="id509587"></a><a class="indexterm" name="id509596"></a><a class="indexterm" name="id509601"></a><a class="indexterm" name="id509606"></a><a class="indexterm" name="id509614"></a><p>
rsync is useful for archiving or copying data and can also be used as a
daemon to provide directories to the network (see
<a class="xref" href="cha.filetrans.html#proc.filetrans.rsyncd" title="Procedure 34.3. Advanced Setup for rsync Synchronization">Procedure 34.3, “Advanced Setup for rsync Synchronization”</a>).
</p><p>
Before using rsync to synchronize files and directories between
different computers, make sure that the following requirements are met:
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li><p>
The package <code class="systemitem">rsync</code> is
installed.
</p></li><li><p>
Identical users are available on both systems.
</p></li><li><p>
Enough disk space is available on the server.
</p></li><li><p>
If you want to benefit from rsync's full potential, make sure that
rsyncd is installed on the system to use as the server.
</p></li></ol></div><div class="sect3" title="34.5.2.1. rsync Basic Mode"><div class="titlepage"><div><div><h4 class="title"><a name="id509678"></a>34.5.2.1. rsync Basic Mode<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#id509678">¶</a></span></h4></div></div></div><p>
The basic mode of operation of rsync does not require any special
configuration. rsync mirrors complete directories onto another system.
Its usage is not much different from a regular copying tool, such as
scp. The following command creates a backup of the home directory of
<code class="systemitem">tux</code> on a backup
server called <code class="systemitem">jupiter</code>:
</p><pre class="screen">rsync -Hbaz -e ssh /home/tux/ tux@jupiter:backup</pre><p>
Use the following command to restore your backup (without option
<code class="option">-b</code>):
</p><pre class="screen">rsync -Haz -e ssh tux@jupiter:backup /home/tux/</pre></div><div class="sect3" title="34.5.2.2. rsync Daemon Mode"><div class="titlepage"><div><div><h4 class="title"><a name="id509718"></a>34.5.2.2. rsync Daemon Mode<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#id509718">¶</a></span></h4></div></div></div><p>
Start the rsyncd daemon on one of your systems to make use of the full
functionality of rsync. In this mode, it is possible to create
synchronization points (modules) that can be accessed without an
account. To use the rsyncd daemon, proceed as follows:
</p><div class="procedure" title="Procedure 34.3. Advanced Setup for rsync Synchronization"><a name="proc.filetrans.rsyncd"></a><p class="title"><b>Procedure 34.3. Advanced Setup for rsync Synchronization</b><span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#proc.filetrans.rsyncd">¶</a></span></p><ol class="procedure" type="1"><li><p>
Log in as <code class="systemitem">root</code> and install the
<code class="systemitem">rsync</code> package.
</p></li><li><p>
Configure your synchronization points in
<code class="filename">/etc/rsyncd.conf</code>. Add a point with its name in
brackets and add the <code class="literal">path</code> keyword like in the
following example:
</p><pre class="screen">
[FTP]
path = /srv/ftp
comment = An Example</pre></li><li><p>
Start the rsyncd daemon as <code class="systemitem">root</code> with <span class="command"><strong>rcrsyncd
start</strong></span>. To start the rsync service automatically during each
system boot, run <span class="command"><strong>insserv rsyncd</strong></span>.
</p></li><li><p>
List all files located in the <code class="filename">/srv/ftp</code> directory
(note the double colon):
</p><pre class="screen">rsync -avz jupiter::FTP</pre></li><li><p>
Initiate the transfer by providing a target directory (in this
example, the current directory is represented by a dot):
</p><pre class="screen">rsync -avz jupiter::FTP .</pre></li></ol></div><p>
By default, files are not deleted while synchronizing with rsync. To
force file deletion, add the <code class="option">--delete</code> option. To make
sure that <code class="option">--delete</code> does not accidentally remove newer
files, use the <code class="option">--update</code> option instead. Any conflicts
that arise must be resolved manually.
</p></div></div><div class="sect2" title="34.5.3. Transferring Files with Unison"><div class="titlepage"><div><div><h3 class="title"><a name="sec.filetrans.unison"></a>34.5.3. Transferring Files with Unison<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetrans.unison">¶</a></span></h3></div></div></div><p>
Before using Unison to synchronize files and directories between
different computers, make sure that the following requirements are met:
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li><p>
The package <code class="systemitem">unison</code> is installed.
</p></li><li><p>
Enough disk space is available on your local and remote computer.
</p></li><li><p>
If you want to benefit from Unison's full potential, make sure that
Unison is also installed and running on the remote computer.
</p></li></ol></div><p>
In case you need help, run Unison with the <code class="option">-doc topics</code>
option to get a full list of available sections.
</p><p>
For permanent settings, Unison allows the creation of
<span class="emphasis"><em>profiles</em></span> that specify Unison preferences such as
the directories (roots) to synchronize, which types of files to ignore,
and other options. The profiles are stored as text files in
<code class="filename">~/.unison</code> with the file extension
<code class="literal">*.prf</code>.
</p><div class="sect3" title="34.5.3.1. Using the GUI"><div class="titlepage"><div><div><h4 class="title"><a name="id509934"></a>34.5.3.1. Using the GUI<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#id509934">¶</a></span></h4></div></div></div><p>
To synchronize different directories with Unison's GUI, proceed as
follows:
</p><div class="procedure"><ol class="procedure" type="1"><li><p>
Start Unison by pressing <span class="keycap">Alt</span>+<span class="keycap">F2</span>
and entering <span class="command"><strong>unison</strong></span>.
</p></li><li><p>
If you run Unison for the first time and without any further options,
you are prompted for a source directory. Enter the source directory
you want to synchronize and click <span class="guimenu">OK</span>.
</p></li><li><p>
Enter the target directory. It can be either local or remote. If you
want to synchronize to a remote directory, choose the method (SSH,
RSH or Socket) and enter the hostname and an optional user.
</p></li><li><p>
If you have not synchronized these two directories before, a warning
dialog appears, informing you that Unison will now compare the
contents of those directories. Close the warning with
<span class="guimenu">OK</span> and wait until Unison has collected the
information from both directories and displays the differences in the
main window.
</p><p>
The left column shows the source directory you have selected, the
third column shows the target directory. If there are differences
between the directories, the <span class="guimenu">Action</span> column shows a
symbol, proposing an action. A green arrow indicates that a file has
been modified, added or deleted in the source or the target
directory. The direction of the arrow indicates the direction that
the change would be propagated if you performed the synchronization
now. A question mark indicates a conflict (both files have been
changed and Unison cannot decide which one to overwrite).
</p><div class="figure"><a name="fig."></a><p class="title"><b>Figure 34.1. File Synchronization Proposal</b><span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#fig.">¶</a></span></p><div class="figure-contents"><div class="mediaobject"><table border="0" summary="manufactured viewport for HTML img" cellspacing="0" cellpadding="0" width="100%"><tr><td><img src="images/unison.png" width="100%" alt="File Synchronization Proposal"></td></tr></table></div></div></div><br class="figure-break"></li><li><p>
To modify the proposals Unison shows for each file (for example, if
you want to change the direction), select the file and click
<span class="guimenu">Right to Left</span> or <span class="guimenu">Left to Right</span>.
With <span class="guimenu">Skip</span>, exclude a file from synchronization.
The symbol in the <span class="guimenu">Action</span> column changes
accordingly.
</p></li><li><p>
To start the synchronization, click <span class="guimenu">Go</span>.
</p></li></ol></div><p>
The next time you start Unison, a dialog box shows the existing
profiles, each specifying a pair of directories to be synchronized.
Select a profile or create a new profile (for another pair of
directories) and perform the synchronization as described above.
</p></div><div class="sect3" title="34.5.3.2. Using the Command Line"><div class="titlepage"><div><div><h4 class="title"><a name="id510119"></a>34.5.3.2. Using the Command Line<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#id510119">¶</a></span></h4></div></div></div><p>
Unison can also be operated through the command line. To synchronize a
local directory to a remote computer, proceed as follows:
</p><div class="procedure"><ol class="procedure" type="1"><li><p>
Open a shell and enter the following command:
</p><pre class="screen">unison -ui text <em class="replaceable"><code>DIR</code></em>
ssh://tux@jupiter.example.com//<em class="replaceable"><code>PATH</code></em></pre><p>
Replace the placeholders with the respective values.
</p></li><li><p>
Unison asks you what to do with your files and directories, for
example:
</p><pre class="screen">local jupiter
<---- new file dir [f]</pre></li><li><p>
Press <span class="keycap">F</span> if you want to follow Unison's
recommendation. For other commands, press <span class="keycap">?</span>.
</p></li><li><p>
Proceed with <span class="keycap">y</span>, if you want to propagate your
updates.
</p></li></ol></div></div></div><div class="sect2" title="34.5.4. Copying Files with FTP"><div class="titlepage"><div><div><h3 class="title"><a name="sec.filetrans.ftp"></a>34.5.4. Copying Files with FTP<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetrans.ftp">¶</a></span></h3></div></div></div><a class="indexterm" name="id510215"></a><a class="indexterm" name="id510224"></a><a class="indexterm" name="id510232"></a><p>
Before configuring your FTP server, make sure that the following
requirements are met:
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li><p>
The package <code class="systemitem">vsftp</code> is
installed.
</p></li><li><p>
You have <code class="systemitem">root</code> access to your FTP server.
</p></li><li><p>
Enough disk space is available on your computer.
</p></li></ol></div><div class="warning"><table border="0" cellpadding="3" cellspacing="0" width="100%" summary="Warning: For Home Networks Only"><tr class="head"><td width="32"><img alt="[Warning]" src="admon/warning.png"></td><th align="left">For Home Networks Only</th></tr><tr><td colspan="2" align="left" valign="top"><p>
This setup is suited for use in home networks only. Do not deploy it to
sites unprotected by firewalls and do not enable world wide access.
</p></td></tr></table></div><p>
To configure an FTP server, proceed as follows:
</p><div class="procedure"><ol class="procedure" type="1"><li><p>
Prepare the FTP server:
</p><ol type="a" class="substeps"><li><p>
Open a shell, log in as <code class="systemitem">root</code>, and save a backup copy of
<code class="filename">/etc/vsftpd.conf</code>:
</p><pre class="screen">cp /etc/vsftpd.conf /etc/vsftpd.conf.bak</pre></li><li><p>
Create an access point for anonymous FTP
</p><pre class="screen">
mkdir ~ftp/incoming
chown -R ftp:ftp ~ftp/incoming</pre></li></ol></li><li><p>
Replace the configuration files according to the preferred scenario
(refer to the manual page of <span class="command"><strong>vsftpd.conf</strong></span> for
advanced configuration options):
</p><div class="variablelist"><dl><dt><span class="term">Allowing Anonymous Read and Write Access</span></dt><dd><pre class="screen">#
listen=YES
# Enable anonymous access to FTP server
anonymous_enable=YES
#
local_enable=YES
# Enable write access
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
# Write log file
xferlog_enable=YES
connect_from_port_20=YES
chown_uploads=YES
chown_username=ftp
ftpd_banner=Welcome to FTP service.
anon_root=/srv/ftp</pre></dd><dt><span class="term">Grant Restricted Permissions to FTP Users (Home Only)</span></dt><dd><pre class="screen">chroot_local_users=YES</pre></dd></dl></div></li><li><p>
Restart the FTP server:
</p><pre class="screen">rcvsftp start</pre></li></ol></div><p>
On the client, just enter the URL
<code class="literal">ftp://<em class="replaceable"><code>HOST</code></em></code> in your browser
or FTP client. Replace <em class="replaceable"><code>HOST</code></em> with the hostname
or IP address of your server. There are many graphical user interfaces
available that are suited to browsing the contents of your FTP server.
For a list of them, just enter FTP at the search prompt of the YaST
package manager.
</p></div></div><div class="sect1" title="34.6. Copying Files between Linux and Windows Computers with SSH"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.filetrans.winssh"></a>34.6. Copying Files between Linux and Windows Computers with SSH<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetrans.winssh">¶</a></span></h2></div></div></div><a class="indexterm" name="id510451"></a><a class="indexterm" name="id510463"></a><a class="indexterm" name="id510472"></a><a class="indexterm" name="id510476"></a><p>
To transfer files from Linux to Windows using SSH, choose one of the
following applications:
</p><div class="variablelist"><dl><dt><span class="term">PuTTY</span></dt><dd><p>
PuTTY is a suite of different command line tools for working with an
SSH daemon. Download it from
<a class="ulink" href="http://www.chiark.greenend.org.uk/~sgtatham/putty.html" target="_top">http://www.chiark.greenend.org.uk/~sgtatham/putty.html</a>.
</p></dd><dt><span class="term">WinSCP</span></dt><dd><p>
WinSCP is very similar to PuTTY, but includes a graphical user
interface. Choose from an Explorer or Norton Commander style. Download
it from <a class="ulink" href="http://winscp.net" target="_top">http://winscp.net</a>.
</p></dd></dl></div><p>
To copy a file from Windows to Linux with PuTTY, proceed as follows (on
the Windows machine):
</p><div class="procedure"><ol class="procedure" type="1"><li><p>
Start PSCP.
</p></li><li><p>
Enter the hostname of your SSH server.
</p></li><li><p>
Enter your login and password to the SSH server.
</p></li></ol></div><p>
To connect from Windows to Linux with WinSCP, proceed as follows (on the
Windows machine):
</p><div class="procedure"><ol class="procedure" type="1"><li><p>
Start WinSCP.
</p></li><li><p>
Enter the hostname of the SSH server and username.
</p></li><li><p>
Click <span class="guimenu">Login</span> and acknowledge the resulting warning.
</p></li><li><p>
Drag and drop any files or directories from or to your WinSCP window.
</p></li></ol></div><div class="note"><table border="0" cellpadding="3" cellspacing="0" width="100%" summary="Note: SSH Fingerprint"><tr class="head"><td width="32"><img alt="[Note]" src="admon/note.png"></td><th align="left">SSH Fingerprint</th></tr><tr><td colspan="2" align="left" valign="top"><p>
With both PuTTY and WinSCP, you must accept the SSH fingerprint when you
log in for the first time.
</p></td></tr></table></div></div><div class="sect1" title="34.7. Sharing Files between Linux Computers"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.filetrans.share"></a>34.7. Sharing Files between Linux Computers<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetrans.share">¶</a></span></h2></div></div></div><a class="indexterm" name="id510647"></a><p>
The following sections feature various methods for sharing data. Use one
of these if you are looking for a permanent solution for data sharing.
</p><div class="sect2" title="34.7.1. Transferring Files with NFS"><div class="titlepage"><div><div><h3 class="title"><a name="sec.filetrans.nfs"></a>34.7.1. Transferring Files with NFS<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetrans.nfs">¶</a></span></h3></div></div></div><a class="indexterm" name="id510673"></a><a class="indexterm" name="id510681"></a><a class="indexterm" name="id510690"></a><p>
To configure the server, proceed as follows:
</p><div class="procedure"><ol class="procedure" type="1"><li><p>
Prepare the system:
</p><ol type="a" class="substeps"><li><p>
Open a shell, log in as <code class="systemitem">root</code>, and grant write permissions to
all users:
</p><pre class="screen">mkdir /srv/nfs
chgrp users /srv/nfs
chmod g+w /srv/nfs</pre></li><li><p>
Make sure that your user name and user ID is known on the client as
well as on the server. Refer to <a class="xref" href="cha.y2.userman.html" title="Chapter 8. Managing Users with YaST">Chapter 8, <i>Managing Users with YaST</i></a> for
detailed instructions about how to create and manage user accounts.
</p></li></ol></li><li><p>
Prepare the NFS server:
</p><ol type="a" class="substeps"><li><p>
Start YaST as <code class="systemitem">root</code>.
</p></li><li><p>
Select <span class="guimenu">Network Services</span>+<span class="guimenu">NFS
Server</span> (this module is not installed by
default. If it is missing in YaST, install the package
<code class="systemitem">yast2-nfs-server</code>).
</p></li><li><p>
Enable NFS services with <span class="guimenu">Start</span>.
</p></li><li><p>
Open the appropriate firewall port with <span class="guimenu">Open Port in
Firewall</span> if you are using a firewall.
</p></li></ol></li><li><p>
Export the directories:
</p><ol type="a" class="substeps"><li><p>
Click <span class="guimenu">Add directory</span> and select
<code class="filename">/srv/nfs</code>.
</p></li><li><p>
Set the export options to:
</p><pre class="screen">rw,root_squash,async</pre></li><li><p>
Repeat these steps, if you need to export more than one directory.
</p></li></ol></li><li><p>
Apply your settings and leave YaST. Your NFS server is ready to use.
</p></li></ol></div><p>
To manually start the NFS server, enter <span class="command"><strong>rcnfsserver
start</strong></span> as <code class="systemitem">root</code>. To stop the server, enter
<span class="command"><strong>rcnfsserver stop</strong></span>. By default, YaST takes care of
starting this service at boot time.
</p><p>
To configure the client, proceed as follows:
</p><div class="procedure"><ol class="procedure" type="1"><li><p>
Prepare the NFS client:
</p><ol type="a" class="substeps"><li><p>
Start YaST as <code class="systemitem">root</code>.
</p></li><li><p>
Select <span class="guimenu">Network Services</span>+<span class="guimenu">NFS
Client</span>.
</p></li><li><p>
Activate <span class="guimenu">Open Port in Firewall</span> if using a
firewall.
</p></li></ol></li><li><p>
Import the remote file system:
</p><ol type="a" class="substeps"><li><p>
Click <span class="guimenu">Add</span>.
</p></li><li><p>
Enter the name or IP address of the NFS server or click
<span class="guimenu">Choose</span> to automatically scan the network for NFS
servers.
</p></li><li><p>
Enter the name of your remote file system or automatically choose it
with <span class="guimenu">Select</span>.
</p></li><li><p>
Enter an appropriate mount point, for example
<code class="filename">/mnt</code>. If you repeat this step with another
exported file system, make sure you choose another mount point
than <code class="filename">/mnt</code>.
</p></li><li><p>
Repeat these steps if you need to import more than one external
directory.
</p></li></ol></li><li><p>
Apply your settings and leave YaST. Your NFS client is ready to use.
</p></li></ol></div><p>
To start the NFS client manually, enter <span class="command"><strong>rcnfs start</strong></span>.
</p><div class="note"><table border="0" cellpadding="3" cellspacing="0" width="100%" summary="Note: Consistent User Names"><tr class="head"><td width="32"><img alt="[Note]" src="admon/note.png"></td><th align="left">Consistent User Names</th></tr><tr><td colspan="2" align="left" valign="top"><p>
If your home network is used by just a small number of users, set up
identical users manually on all machines. If, however, you need a
larger consistent user base across a larger home network, consider
using NIS or LDAP to manage user data. For further information, refer
to Chapter <i>Using NIS</i> (↑Security Guide) and Chapter <i>LDAP—A Directory Service</i> (↑Security Guide).
</p></td></tr></table></div></div><div class="sect2" title="34.7.2. Sharing Files with Samba"><div class="titlepage"><div><div><h3 class="title"><a name="sec.filetrans.smb"></a>34.7.2. Sharing Files with Samba<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetrans.smb">¶</a></span></h3></div></div></div><a class="indexterm" name="id511137"></a><a class="indexterm" name="id511146"></a><a class="indexterm" name="id511154"></a><a class="indexterm" name="id511163"></a><p>
This sections introduces various methods to access files on a Samba
server. Both KDE and GNOME ship with graphical tools for working with
Samba shares. There is also a command line tool for accessing Samba
servers.
</p><div class="sect3" title="34.7.2.1. Accessing Shares with KDE and GNOME"><div class="titlepage"><div><div><h4 class="title"><a name="sec.filetrans.kdegnomesmb"></a>34.7.2.1. Accessing Shares with KDE and GNOME<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetrans.kdegnomesmb">¶</a></span></h4></div></div></div><p>
Both the KDE and GNOME desktops can access Samba shares through their
file browsers. To access your share, proceed as follows:
</p><div class="procedure"><ol class="procedure" type="1"><li><p>
Press <span class="keycap">Alt</span>+<span class="keycap">F2</span> and enter
<code class="literal">smb://jupiter.example.com/<em class="replaceable"><code>share</code></em></code>.
</p><p>
The syntax of this URL is
<code class="literal">smb://<em class="replaceable"><code>HOST</code></em>/<em class="replaceable"><code>SHARENAME</code></em></code>
with <em class="replaceable"><code>HOST</code></em> representing the hostname
(<code class="systemitem">jupiter.example.com</code>) or IP address
and <em class="replaceable"><code>SHARENAME</code></em> representing the share. See
<a class="xref" href="cha.filetrans.html#st.filetrans.share" title="Step 3.b">Step 3.b</a>.
</p></li><li><p>
Log in with the username and password. The password is set in
<a class="xref" href="cha.filetrans.html#st.filetrans.smbpasswd" title="Step 4">Step 4</a> or just hit
<span class="keycap">Enter</span> if no password is needed.
</p></li><li><p>
Drag and drop any files or directories from or to your window.
</p></li></ol></div><p>
If you do not know your workgroup, enter <a class="ulink" href="smb:/" target="_top">smb:/</a> to list
all workgroups available in your network. The Smb4K tool (package
<code class="systemitem">smb4k</code>) can also be used to
display all workgroups in your network and mount them on demand.
</p></div><div class="sect3" title="34.7.2.2. Accessing Shares from the Command Line"><div class="titlepage"><div><div><h4 class="title"><a name="sec.filetrans.smb.cmd"></a>34.7.2.2. Accessing Shares from the Command Line<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetrans.smb.cmd">¶</a></span></h4></div></div></div><p>
If you prefer using the command line, use the
<span class="command"><strong>smbclient</strong></span> command. To log in to your Samba server,
run:
</p><pre class="screen">smbclient //jupiter/share -U tux</pre><p>
Omit the <code class="option">-U</code> option if you are the current user
<code class="systemitem">tux</code>. After logging
in successfully, use some basic commands like <span class="command"><strong>ls</strong></span>
(list contents), <span class="command"><strong>mkdir</strong></span> (create directory),
<span class="command"><strong>get</strong></span> (download file), and <span class="command"><strong>put</strong></span>
(upload file). Use <span class="command"><strong>help</strong></span> to display all commands.
Refer to the manual page of <span class="command"><strong>smbclient</strong></span> for more
information.
</p></div></div></div><div class="sect1" title="34.8. Sharing Files between Linux and Windows with Samba"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.filetrans.linux2win"></a>34.8. Sharing Files between Linux and Windows with Samba<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetrans.linux2win">¶</a></span></h2></div></div></div><p>
Samba is the first choice for transferring files between Windows and
Linux machines. These are the most common use cases for Samba:
</p><div class="variablelist"><dl><dt><span class="term">Transferring Files from Linux to Windows with the SMB Scheme</span></dt><dd><p>
In the easiest case you do not have to configure a Linux server. Use
the <code class="literal">smb:/</code> scheme. For more information, see
<a class="xref" href="cha.filetrans.html#sec.filetrans.kdegnomesmb" title="34.7.2.1. Accessing Shares with KDE and GNOME">Section 34.7.2.1, “Accessing Shares with KDE and GNOME”</a>. Make sure that your
workgroup is identical on both systems and that your directories are
shared.
</p></dd><dt><span class="term">Transferring Files from Windows to Linux Using a Server</span></dt><dd><p>
Configure a Samba server on your Linux computer. See
<a class="xref" href="cha.filetrans.html#proc.filetrans.sambaserv" title="Procedure 34.4. Setting Up a Samba Server">Procedure 34.4, “Setting Up a Samba Server”</a>.
</p></dd></dl></div><div class="tip"><table border="0" cellpadding="3" cellspacing="0" width="100%" summary="Tip: Using Default Registry Entries for Your Windows System"><tr class="head"><td width="32"><img alt="[Tip]" src="admon/tip.png"></td><th align="left">Using Default Registry Entries for Your Windows System</th></tr><tr><td colspan="2" align="left" valign="top"><p>
Some Windows versions (95, 98) require a small change in the registry
for enabling a different password authentication method. Simplify this
step by installing the
<code class="systemitem">samba-doc</code> package and copy the
file <code class="filename">/usr/share/doc/packages/samba/registry</code> to your
Windows drive. Start Windows and incorporate the changes by
double-clicking on this file.
</p></td></tr></table></div><div class="procedure" title="Procedure 34.4. Setting Up a Samba Server"><a name="proc.filetrans.sambaserv"></a><p class="title"><b>Procedure 34.4. Setting Up a Samba Server</b><span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#proc.filetrans.sambaserv">¶</a></span></p><p>
To set up a Samba server, do the following:
</p><ol class="procedure" type="1"><li><p>
Prepare the Samba server:
</p><ol type="a" class="substeps"><li><p>
Start YaST as <code class="systemitem">root</code>.
</p></li><li><p>
Install the <code class="systemitem">samba</code> package.
</p></li><li><p>
Create a directory (for example, <code class="filename">/srv/share</code>).
</p></li></ol></li><li><p>
Create the server configuration:
</p><ol type="a" class="substeps"><li><p>
Select <span class="guimenu">Network Services</span>+<span class="guimenu">Samba Server</span>.
</p></li><li id="st.filetrans.workgroup"><p>
Select one of the workgroups or enter a new one (for example,
<code class="systemitem">Penguin</code>).
</p></li><li><p>
Check <span class="guimenu">Primary Domain Controller (PDC)</span>
</p></li><li><p>
Select <span class="guimenu">During Boot</span> if the Samba service should be
started every time your computer boots. Otherwise select
<span class="guimenu">Manually</span>.
</p></li><li><p>
Activate <span class="guimenu">Open Port in Firewall</span> if you use a
firewall.
</p></li></ol></li><li><p>
Create your Windows share:
</p><ol type="a" class="substeps"><li><p>
Change to the <span class="guimenu">Shares</span> tab and click
<span class="guimenu">Add</span>.
</p></li><li id="st.filetrans.share"><p>
Enter a name and description. The <span class="guimenu">Share Name</span> is
used for accessing the share from your clients. <span class="guimenu">Share
Description</span> describes the purpose of the share.
</p></li><li><p>
Select your path (for example, <code class="filename">/src/share</code>).
</p></li><li><p>
Proceed with <span class="guimenu">OK</span>.
</p></li><li><p>
Activate <span class="guimenu">Allow Users to Share Their Directories</span>.
</p></li></ol></li><li id="st.filetrans.smbpasswd"><p>
Provide a password for all users that are allowed to use this service:
</p><pre class="screen">smbpasswd -a tux</pre><p>
For easier configuration, just hit
<span class="keycap">Enter</span> to leave the password empty.
Take into account that the usernames on your Windows and Linux
computers are probably different. Configuring a consistent user base
for both Windows and Linux is beyond the scope of this document.
</p></li><li><p>
Start the Samba server:
</p><pre class="screen">rcnmb start
rcsmb start</pre></li></ol></div><p>
To check if everything has been successfully configured, enter:
</p><pre class="screen">smbclient -L localhost</pre><p>
After you hit <span class="keycap">Enter</span>, you should get
something like the following:
</p><pre class="screen">Anonymous login successful
Domain=[PENGUIN] OS=[Unix] Server=[Samba 3.0.22-11-SUSE-CODE10]
Sharename Type Comment
--------- ---- -------
share Disk Shared directory
netlogon Disk Network Logon Service
IPC$ IPC IPC Service (Samba 3.0.22-11-SUSE-CODE10)
ADMIN$ IPC IPC Service (Samba 3.0.22-11-SUSE-CODE10)
Anonymous login successful
Domain=[PENGUIN] OS=[Unix] Server=[Samba 3.0.22-11-SUSE-CODE10]
Server Comment
--------- -------
SUSE-DESKTOP Samba 3.0.22-11-SUSE-CODE10
Workgroup Master
--------- -------
TUX-NET jupiter</pre></div><div class="sect1" title="34.9. For More Information"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.filetransfer.moreinformation"></a>34.9. For More Information<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.filetransfer.moreinformation">¶</a></span></h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="bullet"><li class="listitem" style="list-style-type: disc"><p>
<a class="ulink" href="http://en.wikipedia.org/wiki/VFAT" target="_top">http://en.wikipedia.org/wiki/VFAT</a>
</p></li><li class="listitem" style="list-style-type: disc"><p>
<a class="ulink" href="http://en.wikipedia.org/wiki/NTFS" target="_top">http://en.wikipedia.org/wiki/NTFS</a>
</p></li><li class="listitem" style="list-style-type: disc"><p>
<a class="ulink" href="http://en.wikipedia.org/wiki/Fstab" target="_top">http://en.wikipedia.org/wiki/Fstab</a>
</p></li><li class="listitem" style="list-style-type: disc"><p>
<a class="ulink" href="http://en.wikipedia.org/wiki/Network_File_System" target="_top">http://en.wikipedia.org/wiki/Network_File_System</a>
</p></li><li class="listitem" style="list-style-type: disc"><p>
<a class="ulink" href="http://en.wikipedia.org/wiki/File_Transfer_Protocol" target="_top">http://en.wikipedia.org/wiki/File_Transfer_Protocol</a>
</p></li><li class="listitem" style="list-style-type: disc"><p>
<a class="ulink" href="http://en.wikipedia.org/wiki/SSH" target="_top">http://en.wikipedia.org/wiki/SSH</a>
</p></li><li class="listitem" style="list-style-type: disc"><p>
<a class="ulink" href="http://en.wikipedia.org/wiki/Rsync" target="_top">http://en.wikipedia.org/wiki/Rsync</a>
</p></li><li class="listitem" style="list-style-type: disc"><p>
<a class="ulink" href="http://en.wikipedia.org/wiki/Samba_software" target="_top">http://en.wikipedia.org/wiki/Samba_software</a>
</p></li></ul></div></div></div><div class="navfooter"><table width="100%" summary="Navigation footer" border="0" class="bctable"><tr><td width="80%"><div class="breadcrumbs"><p><a href="index.html"> Documentation</a><span class="breadcrumbs-sep"> > </span><a href="book.opensuse.reference.html">Reference</a><span class="breadcrumbs-sep"> > </span><a href="part.reference.mobility.html">Mobility</a><span class="breadcrumbs-sep"> > </span><strong><a accesskey="p" title="Chapter 33. Using Tablet PCs" href="cha.tablet.html"><span>◀</span></a> </strong></p></div></td></tr></table></div></body></html>
ACC SHELL 2018