Username Always stay logged in
Password:

 

Pages: [1]
  Print  
Author Topic: File Sharing  (Read 2103 times)
martinc
Global Moderator
Pro Designer
*****

Karma: +1/-0
Offline Offline

Posts: 148



View Profile
« on: November 15, 2012, 11:54:02 PM »

NFS
(examples based one debian squeeze)
always backup the original file
Code:
cp /file/to/edit /file/to/edit.orig

## SERVER ##
Install
Code:
apt-get install nfs-kernel-server ### (to host)

Configure
/etc/default/nfs-kernel-server
Code:
NEED_SVCGSSD=no # no is default

/etc/default/nfs-common
Code:
NEED_IDMAPD=yes
NEED_GSSD=no # no is default

/etc/idmapd.conf
Code:

# both the client and server require the /etc/idmapd.conf file to have the
# same contents with the correct domain names

[Mapping]
Nobody-User = nobody
Nobody-Group = nogroup
   
/etc/exports               (host shares)
Code:
/media/460 192.168.1.0/24*(rw,no_subtree_check,async)

export the shares and restart the nfs server
Code:
sudo exportfs -a or -ar
sudo /etc/init.d/nfs-kernel-server restart

## CLIENT ##
[i've gotten away with just installing nfs-common and adding the line to fstab]

Install
Code:
apt-get install nfs-common

Configure
/etc/default/nfs-common
Code:
NEED_IDMAPD=yes
NEED_GSSD=no # no is default

/etc/fstab                  (mount shares)
Code:
/dev/sdd1 /media/931 ext4 defaults 0 0
192.168.1.10:/media/460 /srv/460 nfs rw,hard,intr 0 0

/etc/idmapd.conf
Code:

# both the client and server require the /etc/idmapd.conf file to have the
# same contents with the correct domain names

[Mapping]
Nobody-User = nobody
Nobody-Group = nogroup


http://ubuntuforums.org/showthread.php?t=249889
https://help.ubuntu.com/community/SettingUpNFSHowTo
http://www.cyberciti.biz/faq/how-to-ubuntu-nfs-server-configuration-howto/
http://www.cyberciti.biz/tips/ubuntu-linux-nfs-client-configuration-to-mount-nfs-share.html

>Mac
http://www.cyberciti.biz/faq/apple-mac-osx-nfs-mount-command-tutorial/



Assign ports [optional]
/etc/default/nfs-common
Code:
# set statd to listen on port 4000:       [client and server]
...
STATDOPTS="--port 4000"

/etc/modprobe.d/options.conf
Code:
# Set lockd to listen on port 4001 (create the options.conf file if it doesn’t exist)     [client and server]
options lockd nlm_udpport=4001 nlm_tcpport=4001

/etc/modules
Code:
# add lockd to be loaded at boot
...
loop
lockd

/etc/default/nfs-kernel-server
Code:
# set mountd to listen on 4002     [server]
...
RPCMOUNTDOPTS="--manage-gids -p 4002"
..

Code:
# rpcinfo -p
   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp   4000  status
    100024    1   tcp   4000  status
    100021    1   udp   4001  nlockmgr
    100021    3   udp   4001  nlockmgr
    100021    4   udp   4001  nlockmgr
    100021    1   tcp   4001  nlockmgr
    100021    3   tcp   4001  nlockmgr
    100021    4   tcp   4001  nlockmgr
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100003    4   udp   2049  nfs
    100005    1   udp   4002  mountd
    100005    1   tcp   4002  mountd
    100005    2   udp   4002  mountd
    100005    2   tcp   4002  mountd
    100005    3   udp   4002  mountd
    100005    3   tcp   4002  mountd

http://bryanw.tk/2012/specify-nfs-ports-ubuntu-linux/


# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

SAMBA

Install
Code:
apt-get install samba smbfs

Configure
Code:
cp /etc/samba/smb.conf /etc/samba/smb.conf.orig

/etc/samba/smb.conf
Code:
...
####### Authentication #######
...
# "user" needs credentials, "share" lets anyone
security = share
...
guest account = nobody
...
# shares added arbitrarily to the bottom, in following format

[460]                    # [name of share]
comment = my 500gb hd    # comment = description of share
path = /media/460        # path = /path/to/share
read only = no           # read only = yes or no
guest ok = yes           # guest ok = yes or no
writable = yes           # writable = yes or no

Code:
/etc/init.d/samba restart

to test shares
Code:
testparm

http://www.howtoforge.com/creating-a-home-media-and-file-server-with-ubuntu
http://www.debuntu.org/guest-file-sharing-with-samba



Mount SAMBA shares
Guest share
Code:
mount -t smbfs -o username=guest,sec=none //<server>/<share> /your/mount/point
mount -t smbfs -o username=guest,sec=none //192.168.1.2/931  /media/931

Name/Password share
Code:
mount -t smbfs -o username=,password= //<server>/<share>  /your/mount/point
mount -t smbfs -o username=3dmitch,password=lamepassword //192.168.1.2/931  /media/931

/etc/fstab
Code:
//<server>/<share>      /your/mount/point      filesystem      options
//192.168.1.2/931      /media/931      smbfs      rw,hard,intr,username=guest,sec=none    0       0
//192.168.1.2/931      /media/931      smbfs      rw,hard,intr,username=3dmitch,password=lamepassword    0       0
Logged

I have as much authority as the Pope, I just don't have as many people who believe it. --George Carlin
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Greenday Theme Designed By [S.W.T]