Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
How do you want to access, that would narrow your list down a bit. If you want your linux directory to appear as just another directory on your other linux box you should look at ssh or NFS. If you want to share this directory to many other people, maybe ftp. If you wish to do something fancy with it, maybe http.
Or if you want to go to extremes you could have a look at coda and openafs. Coda is promoted to be a more stable networkfs and has features like local imaging. openafs has greater control via access control lists.
Yeah, Samba or NFS is what you need, you just mount them with a mount command just like any other filesystem. Go for samba if you want interoperability with windows machines. It also seems a fair bit easier than NFS to set up, but I havej't had much experience with NFS.
If it's Slackware you're running, I think you just need to make the /etc/rc.d/rc.samba file executable (chmod +x /etc/rc.d/rc.samba) - that will make samba startup on boot providing you then create a smb.conf file (easiest by using the sample one provided).
To do this I *think* you just copy the /etc/samba/smb.conf-sample (is that what it's called?) file to smb.conf in the same dir.
Then you need to edit it to suit your needs (configure samba and set up shares)... it's probably a good idea to find a good samba howto on this.
Finally you can then choose to mount remote shares (using smbmount or mount -t smbfs) or just to browse to them in konqueror by going smb://computername
Alright guys, lets get the right information to this guy and lets not tell him to setup samba to share between two Linux machines, but do it the correct way.
NFS should be used to share between Linux machines.
Samba should be used to setup shares between a Linux and a Windows machines.
Slackware is easy to setup to perform this if you installed NFS:
Machine 1 - To setup as the NFS server to share out a specific directory.
1. Edit your /etc/rc.d/rc.inet2 file and make sure you have these lines uncommented or specified in this file:
# This must be running in order to mount NFS volumes.
# Start the NFS server. Note that for this to work correctly, you'll
# need to load the knfsd module for kernel NFS server support.
# You'll also need to set up some shares in /etc/exports.
# Starting the NFS server:
if [ -x /etc/rc.d/rc.nfsd ]; then
# Done starting the NFS server.
2. Now make sure you actually have the rc.nfsd start up script as well in /etc/rc.d which should look like this:
# This is an init script for the knfsd NFS daemons.
# To use NFS, you must first set up /etc/exports.
# See exports(5) for information on /etc/exports format.
# Written for Slackware Linux by Patrick J. Volkerding <firstname.lastname@example.org>.
# Sanity checks. Exit if there's no /etc/exports, or if there aren't any
# shares defined in it.
if [ ! -r /etc/exports ]; then # no config file, exit:
elif fgrep '/' /etc/exports 1> /dev/null 2> /dev/null ; then
true # there are directories listed in /etc/exports, continue:
else # no shares listed in /etc/exports, exit:
# First, make sure the nfsd kernel module is loaded. You can comment this
# part out if you've built nfsd support directly into the kernel.
if [ -z "`/sbin/lsmod | grep "^nfsd "`" ]; then
echo "Starting NFS services:"
if [ -x /usr/sbin/exportfs ]; then
echo " /usr/sbin/exportfs -r"
if [ -x /usr/sbin/rpc.rquotad ]; then
echo " /usr/sbin/rpc.rquotad"
# Start 8 nfsd servers by default (an old Sun standard):
if [ -x /usr/sbin/rpc.nfsd ]; then
echo " /usr/sbin/rpc.nfsd 8"
if [ -x /usr/sbin/rpc.mountd ]; then
# Test for NFS version 3 so we can offer it if it's there:
/usr/sbin/rpcinfo -u localhost nfs 3 1> /dev/null 2> /dev/null
if [ $? = 0 ]; then # we have NFSv3, so start rpc.mountd offering it:
echo " /usr/sbin/rpc.mountd"
else # start rpc.mountd with only NFSv2, not NFSv3.
echo " /usr/sbin/rpc.mountd --no-nfs-version 3"
/usr/sbin/rpc.mountd --no-nfs-version 3
# NFS file locking services. These are optional but recommended.
# With newer kernels, this starts by itself, but this won't hurt:
if [ -x /usr/sbin/rpc.lockd ]; then
echo " /usr/sbin/rpc.lockd"
if [ -x /usr/sbin/rpc.statd ]; then
echo " /usr/sbin/rpc.statd"
killall lockd 2> /dev/null
killall rpc.statd 2> /dev/null
killall rpc.mountd 2> /dev/null
killall nfsd 2> /dev/null
killall -9 nfsd 2> /dev/null # make sure :)
killall rpc.rquotad 2> /dev/null
/usr/sbin/exportfs -au 2> /dev/null
case "$1" in
echo "usage $0 start|stop|restart"
3. Now you'll want to setup the directory you intend to share in /etc/exports.
It will go in a format something like this giving first the directory to share out, the IP address of the machine your giving access to along with the type of permissions as well. man exports for more details.:
You can also specify the hostname instead of the IP if you add the machine your sharing this directory out to in your /etc/hosts file. Its a good idea to go ahead and add this host to your hosts file.
4. Now you want to either start NFS or restart if its already running, so it recognizes all the changes.
Now on to Machine 2 - The client machine you want to access the share from the server.
1. First edit your /etc/rc.d/rc.inet2
# This must be running in order to mount NFS volumes.
# Start the RPC portmapper:
if [ -x /sbin/rpc.portmap ]; then
echo "Starting RPC portmapper: /sbin/rpc.portmap"
# Done starting the RPC portmapper.
# At this point, we are ready to talk to The World...
# Mount remote (NFS) filesystems:
echo "Mounting remote (NFS) file systems: /sbin/mount -a -t nfs"
/sbin/mount -a -t nfs # This may be our /usr runtime!
# Show the mounted volumes:
/sbin/mount -v -t nfs
# Done mounting remote (NFS) filesystems.
2. To have this automount at boot time.. edit your /etc/fstab file after first creating an empty directory in lets say /mnt called nfs-share, and place a line like this in the fstab file:
And that should be pretty much all you need to do. From there you should find your share in Konq in /mnt/nfs-share. This all depends on if you've installed NFS from the initial install, which I'm sure you have.
Let us know, but you don't need to mess with samba for a Linux to Linux share, that's for Windows to Linux.
Tricky is correct, you should only use samba when you have a mixed win/linux network, for a linux only network use nfs.
Once it's setup correctly you can add the shared directory to your /etc/fstab and mount it at boot.
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
If you want to help test the first step in the next generation of distributed file system access, check out the Linux Userland FileSystem module and tools at: http://lufs.sourceforge.net/lufs/
It will allow you to give clients access to your data through a variety of ways, including ssh and ftp. It requires little set up on the server side (apart from what I would consider basic system setup such as an ssh or ftp server, which has probably already been done).
 Although it's still in beta version numbers, their ssh client access is quite complete and robust, as is, I think, their ftp client.
How about this situation at my home. I have a linux router/web server/file server (hard working P200!) defending us from the internet and providing a central place for downloads, music, pictures, and automatic data backups. On the protected side I have two Win2k machines and a dual boot WinXP/Redhat 8.0. I have samba running on the router sharing drive space and a printer and everything's great for the client windows guys and even Redhat can successfuly connect using Samba.
Now my question is more of a philosophical one. In this situation of a mix of windows and linux accessing a linux box, should I set both Samba and NFS up to share the same shares so each OS can connect using their "native" method? Or would that be more trouble than it's worth? If Samba works and even though it was intended for windows<->linux file sharing, what is the "philosophical" reason against using it for Linux to Linux file sharing?
Just some thought provoking questions for everyone!