|
|
|
|
11.6 Sharing Files between Linux Computers
The following sections feature various methods for sharing data. Use
one of these if you are looking for a permanent solution for data
sharing.
11.6.1 Transferring Files with NFS
To configure the server, proceed as follows:
-
Prepare the system:
-
Open a shell, log in as root, and grant write permissions to
all users: mkdir /srv/nfs
chgrp users /srv/nfs
chmod g+w /srv/nfs
-
Make sure that your user name and user ID is known on the client as well as on the server. Refer to Section 5.0, Managing Users with YaST for detailed instructions about
how to create and manage user accounts.
-
Prepare the NFS server:
-
Start YaST as root.
-
Select .
-
Enable NFS services with .
-
Open the appropriate firewall port with if you are using a firewall.
-
Export the directories:
-
Click and select
/srv/nfs.
-
Set the export options to: rw,root_squash,async
-
Repeat these steps, if you need to export more than one
directory.
-
Apply your settings and leave YaST. Your NFS server is ready to
use.
To manually start the NFS server, enter rcnfsserver start as
root. To stop the server, enter
rcnfsserver stop. By default, YaST takes care of
starting this service at boot time.
To configure the client, proceed as follows:
-
Prepare the NFS client:
-
Start YaST as root.
-
Select .
-
Activate if using a
firewall.
-
Import the remote file system:
-
Click .
-
Enter the name or IP address of the NFS server or click
to automatically scan the network for NFS
servers.
-
Enter the name of your remote file system or automatically choose
it with .
-
Enter an appropriate mount point, for example
/mnt.
-
Repeat these steps, if you need to import more than one
external directory.
-
Apply your settings and leave YaST. Your NFS client is ready to
use.
To start the NFS client manually, enter rcnfs
start.
11.6.2 Sharing Files with Samba
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.
Accessing Shares with KDE and GNOME
Both the KDE and GNOME desktops can access Samba shares through their
file browsers. To access your share, proceed as follows:
-
Press Alt+F2 and enter
smb://jupiter.example.com/share.
The syntax of this URL is
smb://HOST/SHARENAME with HOST representing the hostname
(jupiter.example.com) or IP address and
SHARENAME representing the share. See Step 3.b.
-
Log in with the username and password. The password is set in Step 4 or just hit Enter if no password is needed.
-
Drag and drop any files or directories from or to your window.
If you do not know your workgroup, enter smb:/ to list
all workgroups available in your network. The Smb4K tool (package
smb4k) can also be used to display all
workgroups in your network and mount them on demand.
Accessing Shares from the Command Line
If you prefer using the command line, use the
smbclient command. To log in to your Samba server,
run: smbclient //jupiter/share -U tux
Omit the -U option if you are the current user
tux. After
logging in successfully, use some basic commands like ls
(list contents), mkdir (create directory),
get (download file), and put (upload
file). Use help to display all commands.
Refer to the manual page of smbclient for
more information.
|
|
|