[opensuse] Linux file-sharing
Hi, I'm setting up a new home-server. One of the things it has to do is sharing files, so they can be backed-up. What's the "best" way to share files between linux-machines ? Now I have Samba. I'm thinking of replacing it by NFS. I have a desktop PC that's used by the family. Sometimes I connect with my work-laptop (dual boot linux, seldom Windows). I want personal shares and a "shared" share. Comments please. Thanks, Koenraad Lelong. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wednesday 03 February 2010 11:55:07 am Koenraad Lelong wrote:
Hi,
I'm setting up a new home-server. One of the things it has to do is sharing files, so they can be backed-up. What's the "best" way to share files between linux-machines ? Now I have Samba. I'm thinking of replacing it by NFS. I have a desktop PC that's used by the family. Sometimes I connect with my work-laptop (dual boot linux, seldom Windows). I want personal shares and a "shared" share.
Just something to get started with.. Let's imagine that 10.0.0.10 is the client machine and 10.0.0.11 is the server. /home/user is the directory to be shared at the server. In the server side, create/modify following files: ----------------- /etc/export: add the following line: /home/user 10.0.0.10/24(rw,async) Then you can try nfs with the command (being root): /etc/init.d/nfsserver restart If I remember correctly, yast has a module for further configurting NFS ---------------------- In the client side: -------------- etc/fstab: add the following line: 10.0.0.11:/home/user xxx nfs auto 0 0 where "xxx" is the directory in the client side. Then you can run the commands: chkconfig nfs on umount -a --------------- More info at http://en.opensuse.org/NFS Cheers, Sampsa
Comments please.
Thanks,
Koenraad Lelong.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2/3/2010 1:55 AM, Koenraad Lelong wrote:
Hi,
I'm setting up a new home-server. One of the things it has to do is sharing files, so they can be backed-up. What's the "best" way to share files between linux-machines ? Now I have Samba. I'm thinking of replacing it by NFS. I have a desktop PC that's used by the family. Sometimes I connect with my work-laptop (dual boot linux, seldom Windows). I want personal shares and a "shared" share.
Comments please.
Thanks,
Koenraad Lelong.
Realistically, NFS is a pain in the ass. You have to synchronize users and groups across all your machines, and windows users are pretty much SOL. Don't go there. (i've been there many times and always come away shaking my head). If any windows machines are ever to be used, just continue to use samba. It has some faults, but it is plenty fast enough and as long as you don't let the client side machine manage permissions everything is easy to use and easy to explain to family members. IINBDFI... (If its not broke...) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 02/03/2010 03:55 AM, Koenraad Lelong wrote:
Hi,
I'm setting up a new home-server. One of the things it has to do is sharing files, so they can be backed-up. What's the "best" way to share files between linux-machines ? Now I have Samba. I'm thinking of replacing it by NFS. I have a desktop PC that's used by the family. Sometimes I connect with my work-laptop (dual boot linux, seldom Windows). I want personal shares and a "shared" share.
Comments please.
Thanks,
Koenraad Lelong.
Koenraad, Samba is the way to go. Simple, flexible, etc... For your home setup you will be operating the samba server in 'stand-alone' mode meaning that you are not worried about primary/backup domain controllers, roaming profiles, ldap auth, winbind, etc. The samba setup is simple as pie. I have a openSuSE server setup page at: http://www.3111skyline.com/linux/openSuSE-server.php So if I miss anything below, go take a look there. Here is the basic 5 minute config for samba. (well, I started out shooting for the 5 minute version, it turned into more like the 30 minute version....) First, on your linux box, just create the base dir you would like to 'share' with the family, whatever. Just REMEMBER that in the linux permissions world the 'r-x' (read and execute) bit MUST be set to allow a user to 'descend' into the directory below, so don't get caught setting dir permissions as drw-rw-r-- or your sharing will go nowhere. Rule of thumb, set your directory permissions to 0755 (or 0750 with the users being a member of the group owning the directory) and set file permission to 0660 and you will be fine. For my normal config, I just set up the base share as /home/samba (real original). Then you can do what you want under there. For example, I have the following under samba at home: 21:32 nirvana:/home> l samba total 80 drwxr-xr-x 20 david dcr 4096 2010-02-03 21:32 ./ drwxr-xr-x 20 root root 4096 2010-01-13 09:18 ../ drwxrwx--- 13 david skyline 4096 2009-12-05 02:54 computer/ drwxr-x--- 8 wwwrun www 4096 2007-06-17 21:00 egw/ drwxr-x--- 8 wwwrun www 4096 2007-06-17 21:00 egw3111/ lrwxrwxrwx 1 root root 8 2008-04-08 16:13 egwfiles3111 -> egw3111// drwsr-s--- 2 david skyline 4096 2008-08-22 11:28 engineering/ drwxr-xr-x 3 david dcr 4096 2009-10-26 02:06 family/ drwxrwxr-x 3 wwwrun www 4096 2008-09-17 20:42 gallery2/ drwsrwsr-x 3 david skyline 4096 2008-08-23 21:05 household/ drwxrwxr-x 8 david skyline 4096 2009-10-30 10:18 kids/ drwxrwx--- 12 david ochiltree 4096 2009-03-11 12:00 law/ drwxrwx--- 12 david skyline 4096 2009-05-07 01:57 music/ drwsrws--- 10 david parents 4096 2009-09-18 17:37 parents/ drwxr-xr-x 6 david parents 4096 2009-03-12 19:13 pets/ drwsrws--- 2 david skyline 4096 2008-08-01 08:08 pharmacy/ drwsrwsr-x 8 david skyline 4096 2009-05-17 11:20 pictures/ drwxrwx--- 7 david skyline 4096 2009-06-24 09:55 properties/ drwxrwx--- 14 david skyline 4096 2008-08-20 23:19 skyline/ drwxrwxr-x 5 david skyline 4096 2009-08-23 23:36 sports/ drwxr-x--- 12 david skyline 4096 2009-10-11 01:15 video/ One of the beautiful things you can do with samba is get very fine-grained control over your files with nothing more than basic linux permissions. No extensive ACL's required (samba does that for you) Above you can tell that everybody (kids included) is a member of the skyline group and has read/write permission to almost everything except egroupware (egw) files, engineering, family, law, parents, and pets. Basically the 'parents' group just keeps the kids out of files they might delete, etc. and the webserver has write access for the egroupware data files. Then further down the tree, for example under pictures, you can do something like this and so on....: 21:39 nirvana:/home> ls -1 samba/pictures/family_pictures/ portraits tolower-ext.sh working year2001 year2002 year2003 year2004 year2005 year2006 year2007 year2007_other year2008 year2009 The samba setup is simple at this point. All you need to do is set up your /etc/samba/smb.conf and then issue the commands to start nmbd and smbd (suse splits them, just about everyone else has smbd start nmbd by default) No big deal, just issue (as root) rcnmb start rcsmb start and then configure both to start at boot time with (as root): chkconfig nmb on chkconfig smb on and you are done setting up the daemons. Now the config. Again simple for a home server in standalone mode. Here is the generic standalone config I use and a short explanation in the comments below. Your smb.conf has basically 2 different types of sections, (1) a [global] section for basic server behavior, and then (2) your share definitions. example: [samba] [homes] etc.. For your home server you should be able to basically cut and paste the following (with the workgroup, username, groupname, and addresses adjusted to match your setup) 21:52 nirvana:/home> noc /etc/samba/smb.conf [global] use sendfile = No workgroup = rb_law # This is just your windows workgroup name server string = Samba %v printcap name = cups load printers = yes printing = cups show add printer wizard = no disable spoolss = yes log file = /var/log/samba/log.%m max log size = 100 time server = yes # Allows samba to serve as a time server admin users = david # Set yourself as the admin user smb ports = 139 hosts allow = 192.168.7. # Just list your local network (note: '.' at end) domain logons = yes # Just allows logon scrips to run if you want map to guest = bad user security = user # This controls the 'mode', user= stand-alone encrypt passwords = yes smb passwd file = /etc/samba/smbpasswd socket options = TCP_NODELAY local master = yes os level = 69 # Insures you samba box is the local browsemaster domain master = yes # A bit more insurance preferred master = yes # same name resolve order = wins lmhosts bcast wins support = yes # Specify samba will be the wins server as well dns proxy = no usershare allow guests = No [homes] # This provides the users ~/ dir on the server comment = Home Directories browseable = no writable = yes [samba] # The 'samba' share we spoke of comment = My share files, etc. path = /home/samba # The actual path to the base share valid users = @skyline, anna # Specifies who can access '@group, user1, ..' force group = skyline # allow you to specify ownership of new files admin users = david # You browseable = Yes # It can be seen when browsing the network writeable = Yes # It can be written to inherit permissions = yes # New directories inherit permission from parent #[config] # Very useful/dangerous share for YOU only # comment = Nirvana Config # provides you root access from any client # path = / # shares entire root filesys - use carefully # valid users = david # you only # force user = root # work as root # force group = root # make files owned by root # browseable = no # nobody but you can see it # writeable = Yes # you can write to it [printers] # Just the printer spool comment = All Printers path = /var/spool/samba # Don't forget to set permission to 0777 browseable = no guest ok = yes public = yes writable = no printable = yes create mode = 0700 use client driver = yes **Note: the 'config' share above is a tool I use to manage my server over a smb connection when needed. Comment this share out if you don't intend to use it. It's basically a convenience tool for being able to open kate/gimp/etc to edit config files/web server graphics (gimp won't use remote files over sftp://), but you can accidentally hose yourself with a stray 'chown -R dir' or 'rm -r somedir' and really effect a bit more than you originally thought. I only include it because it is very useful to me, but comment it out if you don't use it. With the smb.conf above all of your users will have their home directories available for private storage and you have the [samba] share for all users to share files from. Almost done. NOTE: samba provides a config test tool called 'testparm' that checks /etc/samba/smb.conf for errors. Just run it before you start your server to confirm you are OK. It is a standard rule "Thou shall run testparm after any changes to smb.conf -- just do it :p" Adding your users to the smbpasswd file so that your users will have access to the shares. This is where the "stand-alone" mode comes from. Your users do not automatically have access to the samba share by virtue of having a linux account on the box. They NEED a samba account. Here you can save yourself a bit of pain if you have windows users that will be connecting (the wife for instance..) MAKE THE SAMBA USER AND SAMBA PASSWORD THE SAME AS THE WINDOWS USER & PASSWORD and windows will automatically connect without prompting for a password. Cool deal. To add your users to the smbpasswd file, it is simply (as root): smbpasswd -a username then enter the password when prompted Example: [22:31 nirvana:/home] # smbpasswd -a jordan New SMB password: Retype new SMB password: Added user jordan. Last but not least, you now need to mount your new shares on the client machines so that your users can access the files. From the windows boxes, just do the normal 'map network drive' and provide the server and share information in the dialog: yourserver\\yourshare On your linux boxes, just create a mount point for the share from your samba server. I use /mnt/hostshare. So as root: mkdir /mnt/box1samba then mount the share with mount.cifs: mount.cifs //yourserver/yourshare /mnt/box1samba -o username=david,uid=1000,credentials=/home/david/.dcr/mountcfile **Note, the credentials file above just holds the username/password combination which prevents the credentials from having to be specified on the command line. The format of the credentials file is: username=david password=notmyrealpassword Alternatively, you can just specify the password on the command line with: mount.cifs //yourserver/yourshare /mnt/box1samba -o user=david,pass=notmyrealpassword,uid=1000 You are now done! Your samba server will serve you well for years and you will be amazed at the capabilities samba offers. In my opinion, there is simply no comparison with NSF. Samba is the way to go. I have the full annotated version of my smb.conf at: http://www.3111skyline.com/download/linux/apps/samba/smb.conf.home.server.tx... There are quite a few more share in it and a few additional tips and tricks there (samba serving as your print to pdf server, etc..) After you server is running, you can test your share access with 'smbclient -Uusername -Lhostname' which will list the share available. From localhost it is just 'smbclient -U% -Llocalhost'. Example: 21:22 alchemy:~/img/brd/toolbar> smbclient -Udavid -Lnirvana Enter david's password: Domain=[RB_LAW] OS=[Unix] Server=[Samba 3.4.2-1.1-2223-SUSE-SL10.3] Sharename Type Comment --------- ---- ------- samba Disk Nirvana - Skyline, Pictures, Law nemesis Disk Nirvana Videos iso Disk iso Install Media print$ Disk pdf-gen Printer PDF Generator print-pdf IPC$ IPC IPC Service (Samba 3.4.2-1.1-2223-SUSE-SL10.3) hp_laserjet_4 Printer Nirvana HP Laserjet 4 david Disk Home Directories Domain=[RB_LAW] OS=[Unix] Server=[Samba 3.4.2-1.1-2223-SUSE-SL10.3] Server Comment --------- ------- KILLERZ Zmans KillerZ Box SUPERSFF Samba 3.4.5 ARCHANGEL Samba 3.4.5 RIPPER XP2800 NIRVANA Samba 3.4.2-1.1-2223-SUSE-SL10.3 Workgroup Master --------- ------- RB_LAW NIRVANA That will let you know that everthing is working OK. If you get stuck, head to www.samba.org. All the resources and troubleshooting you could ever want are there for the browsing. Good luck! -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 3 February 2010 11:55, Koenraad Lelong
Hi,
I'm setting up a new home-server. One of the things it has to do is sharing files, so they can be backed-up. What's the "best" way to share files between linux-machines ? Now I have Samba. I'm thinking of replacing it by NFS. I have a desktop PC that's used by the family. Sometimes I connect with my work-laptop (dual boot linux, seldom Windows). I want personal shares and a "shared" share.
Comments please.
Hi Koenraad, I use sshfs with fuse to share directories between my Linux machines. I set up the ssh keys between the machines and test that I can login with ssh from the one machine to the other with the selected user account without it asking for a password. Then I add the required entries in the fstab and mount them. You can make them user controlled or permanent. I use gkrellm and it has a nice section where you can mount and unmount drives with a click of a button. I don't know if there are sshfs or fuse clients for Windows. I use WinSCP for the rare occasions when I need to trasfer files between Windows and Linux HTH -- Andre Truter | Software Consultant | Registered Linux user #185282 Jabber: andre.truter@gmail.com | http://www.trusoft.co.za ~ A dinosaur is a salamander designed to Mil Spec ~ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hi, On Wednesday 03 February 2010 Koenraad Lelong wrote:
I'm setting up a new home-server. One of the things it has to do is sharing files, so they can be backed-up. What's the "best" way to share files between linux-machines ? Now I have Samba. I'm thinking of replacing it by NFS. I have a desktop PC that's used by the family. Sometimes I connect with my work-laptop (dual boot linux, seldom Windows). I want personal shares and a "shared" share.
Maybe the following chapters in our reference are useful for you: * Samba http://www.novell.com/documentation/opensuse112/book_opensuse_reference/data... * Sharing File Systems with NFS http://www.novell.com/documentation/opensuse112/book_opensuse_reference/data... More general information can be found in the chapter "Copying and Sharing Files": http://www.novell.com/documentation/opensuse112/book_opensuse_reference/data... -- Thomas Schraitle ---------------------------------------------------------------------- SUSE LINUX GmbH >o) Documentation Specialist Maxfeldstrasse 5 /\\ 90409 Nuernberg _\_v http://en.opensuse.org/Documentation_Team http://lizards.opensuse.org/author/thomas-schraitle/ --------------------------------------------------------------------- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (6)
-
Andre Truter
-
David C. Rankin
-
John Andersen
-
Koenraad Lelong
-
Sampsa Riikonen
-
Thomas Schraitle