Announcement

Collapse
No announcement yet.

Sharing files and folders in Kubuntu

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Sharing files and folders in Kubuntu

    I have several PC's here at home now running Kubuntu. In addition, I have a server running Ubuntu server with KDE4 on top (not the full Kubuntu desktop). I installed KDE to make some tasks a little easier as I am not sitting full time administrating the server :-)

    On the server, I have Samba running with a few folders shared, and it is working fine. And as a tip to all - the Samba server module in the System settings is just wonderful. Takes all the guesswork out of configuring Samba. You still have to know what you are doing, but you have all options in front of you instead of having to search everywhere to find the right syntax etc.

    But as I am trying to get everything networked between the Kubuntu systems and the server, I thought it was wrong to use Samba and introduce a "weaker" link between two strong systems.

    I assume NSF is still the most efficient and solid system to use between Linux systems? Or do anyone have any other suggestions? I want to use something that is really solid and really can get the highest possible speed over the network.

    Another advantage I can see with NFS is that from what I understand, a folder from a server will be mounted in a folder on the client. This means that applications should not really know that the folder is on a server.

    I used Dolphin on the server to find the folder I wanted to share and right-clicked on it, choosing Properties. There I went to the Sharing tab, and clicked on setting up filesharing.

    After entering the password, I got a new dialog. Here I can see the Samba shares, and I can also see they have not been shared via NFS. So I chose the first one and clicked on Edit. In the dialog that comes up, it is possible to edit the Samba information, but not the NFS info. Everything that has to do with NFS is greyed out.

    I could be totally wrong here, but I thought NFS was something that existed on all Linux systems. Do I have to install anything else? How can I check that I have everything that I need? (bring on the commands :-) )

    As I have not shared anything on the server yet, I have not been able to find out how easy it is to mount a share on a client. That will come after the server is working.

    I know this is not strictly a Kubuntu problem, but hope you find enough overlapping problems here that it is still interesting to keep here. The next thing (the clients) will be all Kubuntu :-)
    Regards,
    Oceanwatcher
    Blog: http://www.wisnaes.com/
    Pictures: http://www.oceanwatcher.com/
    Software tips (in Norwegian): http://www.datahverdag.com/

    #2
    Re: Sharing files and folders in Kubuntu

    I haven't set up NFS, so I can't speak to that, but have you considered just using plain old SSH? It works pretty much out of the box if you're only moving files among Linux systems, and Dolphin and other file managers can work with folders over SSH easily.

    Comment


      #3
      Re: Sharing files and folders in Kubuntu

      Must admit I am searching all over to find as much info as possible.

      Found a tip about installing nfs-common and nfs-kernel-server, so I did that on the server and rebooted. Then the NFS part of the sharing suddenly came to life :-) Seems like KDE (and Kubuntu) do not come with the necessary tools to share via NFS. I have exported a folder. Now, I just need to figure out how to mount it on the client.

      I already have Samba set up. That part is easy. But I can not get to the Samba shares via the applications. If I want to open a file on the server, I first have to copy it to a local folder... As those shares are not really mounted, they will not show up in Firefox etc. when you want to save something.
      Regards,
      Oceanwatcher
      Blog: http://www.wisnaes.com/
      Pictures: http://www.oceanwatcher.com/
      Software tips (in Norwegian): http://www.datahverdag.com/

      Comment


        #4
        Re: Sharing files and folders in Kubuntu

        This page is similar and very clear in what is needed:

        https://help.ubuntu.com/9.04/serverg...le-system.html

        So I did the following:

        Shared a folder on the server by right-clicking and checkmarking the right stuff under sharing.

        Made sure my username and password was the same on the laptop and the server.

        Made a folder on the laptop to use as mount point

        In a terminal, I typed this:

        Code:
        sudo mount 192.168.1.25:/home/files /home/username/files
        Voila, it worked! Now I have to try it on my friends system.
        Regards,
        Oceanwatcher
        Blog: http://www.wisnaes.com/
        Pictures: http://www.oceanwatcher.com/
        Software tips (in Norwegian): http://www.datahverdag.com/

        Comment


          #5
          Re: Sharing files and folders in Kubuntu

          NFS is the way to go. I only use Samba for networking with Windows machines. I am currently running a Windows 7 RC in VMWare Player, and I noticed that Windows 7 has support for NFS. I think Vista does also. I have not ried to work with this yet, but intend to experiment with it soon.

          SSH works well also, but I find it a lot slower than NFS.

          Comment


            #6
            Re: Sharing files and folders in Kubuntu

            To me, speed is very important. And I am definitely getting closer to have it working. Going to try to add NFS to WinXP as well.

            BUT - I hit a snag yesterday.

            It worked fine with my admin account, but when I try to set it up with a user that is not admin or sudo enabled, it does not work. Not sure what end the problem is in, server or client.
            Regards,
            Oceanwatcher
            Blog: http://www.wisnaes.com/
            Pictures: http://www.oceanwatcher.com/
            Software tips (in Norwegian): http://www.datahverdag.com/

            Comment


              #7
              Re: Sharing files and folders in Kubuntu

              Let me see your exports file from the server and your fstab file from the client.

              Comment


                #8
                Re: Sharing files and folders in Kubuntu

                Check your fstab and exports files against the instructions at this site:
                http://littlegirl.hostrator.com/NFSHowTo.html .
                Clearest how-to I've ever seen. Doesn't explain much, though,

                Comment


                  #9
                  Re: Sharing files and folders in Kubuntu

                  The line for the NFS share in fstab:

                  Code:
                  192.168.1.99:/windows/files  /media/trab1   nfs  defaults
                  /media/trab1 privileges is 777. Same with the folder on the server.

                  Have to find the export file first as I shared it by right clicking in Dolphin>Properties>Share>Configure File Sharing.

                  Although it is not a big problem to open this share to "the world" (it is a very small home network protected by a firewall), it would be good to learn how to only share it with the people that has an account on this particular server and is member of a particular group. So I would prefer to limit the users that are allowed on it to one group only.

                  Ok. I read through the howto mentioned, and some of it made sense. But I am a little hesitant to using it on my own setup as I am using Ubuntu Server with KDE on top of it. I really do not want to break anything on it. However, using it on my friends setup is just perfect. He uses a plain Kubuntu 9.04 and want his wife to see one of his folders. But - I would LOVE to see a one sided version of the document - in other words - what can I skip if I only need to share files on one PC with a number of PC's. My friend want his wife to see the share with all the files they need for work. But he also want to have a share that he can use to transfer stuff to the kids PC. They should of course not have access to any other stuff. So there is a need to differentiate here. That is why I think it is a good thing to use groups.
                  Regards,
                  Oceanwatcher
                  Blog: http://www.wisnaes.com/
                  Pictures: http://www.oceanwatcher.com/
                  Software tips (in Norwegian): http://www.datahverdag.com/

                  Comment


                    #10
                    Re: Sharing files and folders in Kubuntu

                    Originally posted by Oceanwatcher
                    The line for the NFS share in fstab:

                    Code:
                    192.168.1.99:/windows/files  /media/trab1   nfs  defaults
                    ....
                    My friend want his wife to see the share with all the files they need for work. But he also want to have a share that he can use to transfer stuff to the kids PC. They should of course not have access to any other stuff. So there is a need to differentiate here. That is why I think it is a good thing to use groups.
                    The kids' PC, if it's running Linux, should have an fstab file. Put a line in that fstab that specifies what folder on the server is to be mounted on the kids' PC. So:
                    Code:
                    192.168.1.99:/windows/files/kidstuff  /media/serverfiles  nfs  rw,noexec  0  0
                    The kids' computer will have a folder /media/serverfiles that will contain everything that's in /windows/files/kidstuff on the server. It won't be possible to navigate to a higher folder on the server (e.g., /windows/files) from the kids' computer, because the parent folder from there is its own /media.

                    Comment


                      #11
                      Re: Sharing files and folders in Kubuntu

                      Originally posted by Oceanwatcher
                      The line for the NFS share in fstab:

                      Code:
                      192.168.1.99:/windows/files  /media/trab1   nfs  defaults
                      Modify that to read:

                      Code:
                      192.168.1.99/windows/files /media/trab1 nfs users,rsize=8192,wsize=8192,timeo=14,intr,atime,auto,rw,dev,exec,suid 0 0
                      Your exports file will be at /etc/exports on the server.

                      /media/trab1 privileges is 777. Same with the folder on the server.

                      Have to find the export file first as I shared it by right clicking in Dolphin>Properties>Share>Configure File Sharing.

                      Although it is not a big problem to open this share to "the world" (it is a very small home network protected by a firewall), it would be good to learn how to only share it with the people that has an account on this particular server and is member of a particular group. So I would prefer to limit the users that are allowed on it to one group only.

                      Ok. I read through the howto mentioned, and some of it made sense. But I am a little hesitant to using it on my own setup as I am using Ubuntu Server with KDE on top of it. I really do not want to break anything on it. However, using it on my friends setup is just perfect. He uses a plain Kubuntu 9.04 and want his wife to see one of his folders. But - I would LOVE to see a one sided version of the document - in other words - what can I skip if I only need to share files on one PC with a number of PC's. My friend want his wife to see the share with all the files they need for work. But he also want to have a share that he can use to transfer stuff to the kids PC. They should of course not have access to any other stuff. So there is a need to differentiate here. That is why I think it is a good thing to use groups.
                      Under NFS access control is handled by the hosts.allow and hosts.deny files in the /etc folder. See Sections 5 and 6 in littlegirls instructions arist posted above, which are the instructions I used to set up NFS, and they worked great. You only have to set up one server, the other computers are clients. You just have to use littlgirls instructions, for the client on each machine. If you want to share files over the network that are not on the server, then you would have to set up a client and server on eah machine (which is what I do). I don't have a dedicated server, all off my computeres a both servers and clients.

                      Comment


                        #12
                        Re: Sharing files and folders in Kubuntu

                        Originally posted by arist
                        Check your fstab and exports files against the instructions at this site:
                        http://littlegirl.hostrator.com/NFSHowTo.html .
                        Clearest how-to I've ever seen. Doesn't explain much, though,
                        Thanks for your kind words, and hopefully the explanations I've now added will make everything more clear. Let me know if I need to go into more detail.
                        There is no spoon.

                        Author of the Mostly Linux blog.

                        Comment


                          #13
                          Re: Sharing files and folders in Kubuntu

                          Originally posted by Oceanwatcher
                          Ok. I read through the howto mentioned, and some of it made sense. But I am a little hesitant to using it on my own setup as I am using Ubuntu Server with KDE on top of it. I really do not want to break anything on it.
                          It's a good idea to back up any file you are going to edit. I probably should include instructions for doing that on my page. This way, if you do break anything on your system, you can easily undo what you did.

                          Originally posted by Oceanwatcher
                          But - I would LOVE to see a one sided version of the document - in other words - what can I skip if I only need to share files on one PC with a number of PC's. My friend want his wife to see the share with all the files they need for work. But he also want to have a share that he can use to transfer stuff to the kids PC. They should of course not have access to any other stuff. So there is a need to differentiate here.
                          Your wish is my command. This evening I'll create a couple of use case examples on separate pages and link to them from the NFS How To page.
                          There is no spoon.

                          Author of the Mostly Linux blog.

                          Comment


                            #14
                            Re: Sharing files and folders in Kubuntu

                            Little Girl, welcome!! I hope you become a regular poster here.

                            Comment


                              #15
                              Re: Sharing files and folders in Kubuntu

                              Originally posted by Little Girl

                              It's a good idea to back up any file you are going to edit. I probably should include instructions for doing that on my page. This way, if you do break anything on your system, you can easily undo what you did.

                              Your wish is my command. This evening I'll create a couple of use case examples on separate pages and link to them from the NFS How To page.
                              My mouth is open and my jaw is on the floor I am totally delighted to hear this :-)

                              What I was referring to when I said I did not want to break anything is that a Ubuntu server might have other things going than a desktop system and I want to avoid installing something that might break the functionality of the server. At the moment, I am running

                              Apache
                              Php
                              MySQL
                              bind9
                              Samba (this one will eventually be disabled)
                              Cups
                              and a few other things I do not remember at the moment :-)

                              The hosts allow/deny: Will it interfere with the DNS?

                              And I will also join in welcoming you here. Good to have someone that is really knowledgeable on this here! Fantastic!

                              The reason for me in trying to get to know this, is that it seems to me that NFS is the type of sharing that gives the best speed. And I really need speed...

                              For the scenario that you already have described, NFS should be possible to set up through a separate setting in the system settings. "Add NFS share" would be a good title. Then a simple interface that ask for a few things (after entering sudo password):

                              IP/name of the server (192.168.1.99)
                              Full path to the folder on the server (/windows/trab1)
                              Path to where the share should be mounted (browse button where you can also create new folder as you are already sudo)
                              Do you want this share to be automounted every time the computer starts? (yes/no)
                              Maybe an advanced section for things not covered here.

                              The rest should be a job for the program to set up.

                              On the server side, there is already a way to set up shares through the GUI. But there should be an addition - do you want to advertise this share? (yes/no) - As I understand, it is possible to add this to Avahi so that a share is announced and can be detected via zeroconf...

                              Why have this beautiful GUI and still make people jump through all these hoops to share a folder? This is something sooooo basic on Windows and MacOSX...

                              But until that becomes a reality, I will read and preach your tutorials! :-)
                              Regards,
                              Oceanwatcher
                              Blog: http://www.wisnaes.com/
                              Pictures: http://www.oceanwatcher.com/
                              Software tips (in Norwegian): http://www.datahverdag.com/

                              Comment

                              Working...
                              X