Announcement

Collapse
No announcement yet.

share files between two pcs on the same nework

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

    [SOLVED] share files between two pcs on the same nework

    I have two PCs on a wifi network and want to be able to access files in both directions.
    One box is running Kubuntu 18.04 and the other 16.10

    I also want the mounts to be permanent.

    I have seen so many posts on this that I'm getting confused.

    Help and advice needed!

    #2
    https://mostlylinux.wordpress.com/network/nfshowto/
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    Comment


      #3
      Exact same site/guide I used several years ago to network my two laptops.
      Using Kubuntu Linux since March 23, 2007
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #4
        If your strictly Linux, NFS is the way to go. I literally just did this to connect a single folder on my laptop to my desktop. A quick rundown; one PCs will be the NFS server, the client will mount the NFS share in fstab, and you're done.

        Might I suggest using the "Public" folder in your home as the mount location? That's what I do. Then it's clear to all my users that the files in there are shared, as in "Public."

        I think the HowTo linked to is unnecessarily complex for basic at-home, one-user, 2-PCs. If you're the only user, here's what I would do;

        On both machines;
        1. Install nfs-common


        On the 18.04 machine;
        1. Install nfs-kernel-server
        2. Edit /etc/exports and add this line: /home/bill/Public somehostname(rw,sync)
        3. Instead of "somehostname", use the hostname of the 16.04 machine.
        4. Run the command sudo exportfs -a


        On the 16.04 machine;
        1. Edit /etc/fstab and add this line: someotherhostname:/home/bill/Public /home/bill/Public nfs nofail,x-systemd.automount,x-systemd-device-timeout=10,_netdev,bg,hard,timeo=1,retrans=5,intr, rsize=131072,wsize=131072,noatime,nodiratime 0 0
        2. Obviously, use the hostname of the 18.04 machine instead of "someotherhostname"
        3. Run the command sudo mount /home/bill/Public


        and I think that's all you have to do. Now any file you put in the Public folder will be available on both machines.

        You should read up on the options for the fstab mount (there's a lot of them) and the export options if you're worried about security but IMO if you're behind a firewall (and you should be) this is fine. By "exporting" only to your desktop you remove a lot of concern - again my opinion. I'm sure the "security conscience" bunch will chime in on that.

        If you have multiple users and want everyone to share the Public files, the set up is slightly different.

        Please Read Me

        Comment


          #5
          share files between two pcs on the same nework

          I've read many posts on this, most of them quite old.
          There also seems to many different approaches.
          I have two pcs, both running Kubuntu 18.04, what is the best way to have all the files on each visible to the other.
          It would be preferred that the mounts be permanent.

          Comment


            #6
            Is used this guide years ago, but I think that it is still relevant.

            https://mostlylinux.wordpress.com/network/nfshowto/
            Using Kubuntu Linux since March 23, 2007
            "It is a capital mistake to theorize before one has data." - Sherlock Holmes

            Comment


              #7
              Set up both PCs as NFS servers. Export (share) the desired folder(s) on both PCs. Mount the shared folders on each PC as a NFS client.

              Alternately, you could have one PC hold all the files and just mount it on the other. The downside to this approach is the PC holding all the files would need to be on. Actually, even with first option, both we would need to be on to share files.

              Another idea could be to sync a folder on demand with the other PC. For example, any files you want to share to the other PC you put in your "Public" folder. Then when the other PC is on, you could force a sync (using rsync) to copy and files across the network. You could do this with Dolphin or using a script whenever the other PC is on.

              Really, the best way to do it is determined by your work flow - like if you normally have both of the PCs on at the same time, or you use one or the other and just want all the files duplicated, etc. Talk a bit more about how you would use this and maybe the best way to do it will become obvious.

              Please Read Me

              Comment


                #8
                Thanks for quick responses, each pc is used for different purposes but with the need to access some data on the other. I'll try the excellent link provided by Snowhog and report back

                Comment


                  #9
                  So differences with using SAMBA vs NFS;

                  SAMBA is also accessible with a Windows computer and Dolphin can mount a SAMBA share if it's set up properly.

                  NFS shares are usually mounted in fstab so you'll want to set it up so that your boot continues even if they are not mountable. It's not hard to do, you just need to be aware that a mount described in fstab that is "missing" when you boot will likely halt or delay boot up. A better way would be to either have the NFS share mounted with a script that "fails" gracefully if the other PC isn't on and have a way to cause it to mount automatically when the other PC is detected. PAM MOUNT can do this but a simple script could also.

                  Please Read Me

                  Comment


                    #10
                    After some delay, I proceeded with the link provided by snowhog. Initially one machine wouldn't boot at all due to my own error the fstab line (I think).
                    So to recap, I have two machines (Vostro and Compaq) both running Kubuntu 18.04
                    The Compaq machine has Vostro mounted but can't access the drive:-
                    Code:
                    An error occurred while accessing 'Home', the system responded: mount: /home/bill/shared: operation permitted for root only.
                    The Vostro machine doesn't show any mounts.
                    So, some progress but any further advice would be welcome

                    Comment


                      #11
                      After some delay I have recently followed GreyGeek's link.
                      My setup is two computers ('Vostro' and 'Compaq') each running Kubuntu 18.04
                      Each computer mounts the share and is shown in Dolphin but access is denied:-
                      Code:
                      An error occurred while accessing 'home/bill on 192.168.1.65', the system responded: mount: /home/bill/shared: operation permitted for root only.
                      Any further advice would be much appreciated

                      Comment


                        #12
                        Post your fstab line, but it's obviously a permissions problem. Network mounts still retain normal ownership and permission settings.

                        In a nutshell, you can either;
                        Mount with settings that allow full access.
                        Use the same user/group ID (number not name).
                        Create a common group and assign ownership of all the files to that group.

                        There's probably a few more ways that aren't coming straight to my mind this early. The "best" way to do it will depend on your usage, your desire/need for security, how many users you have, etc.

                        Please Read Me

                        Comment


                          #13
                          Have changed the Compaq machine name to 'compaq'
                          so to confirm, there are two machines, Compaq (named 'compaq') and Vostro (named 'bill')
                          here is the fstab line in the Vostro machine.
                          Code:
                          192.168.1.65:/home/compaq /home/bill/shared nfs rw,hard,intr,noexec 0 0
                          Since making a fresh install on the Compaq machine I'm seeing the share on both machines but get the same error on both

                          Comment


                            #14
                            My wish is to have access to all the files on the 'other' computer.
                            No one else has access to these machines so its not a big security issue.

                            I have noticed that the error occurs in Dolphin when I click on the share shown under 'Devices' in the lower left panel. Clicking on the 'shared' folder shown in Vostro/Dolphin shows the files in Compaq/shared and vice versa

                            Comment


                              #15
                              Well, this error:
                              An error occurred while accessing 'home/bill on 192.168.1.65', the system responded: mount: /home/bill/shared: operation permitted for root only.
                              Means it's not mounted and you're attempting to mount it as your user. Only root can mount things and you don't have "auto" in fstab so it's not mounting it at boot.

                              Options:
                              • Add "users" to the fstab options and you will be able to mount it manually as your user.
                              • Add "auto" to the fstab options and it will mount at boot up - note if the other computer is not on when you attempt the mount, you may experience a long delay until the NFS mount fails.


                              Sounds like "users" is the best choice for you:

                              192.168.1.65:/home/compaq /home/bill/shared nfs users,rw,hard,intr,noexec 0 0

                              Please Read Me

                              Comment

                              Working...
                              X