Announcement

Collapse
No announcement yet.

NFS share on Kubuntu 17.10

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

    NFS share on Kubuntu 17.10

    as i was checking over my server i discovered it was running 17.10 so thats good news saves me having to do a clean install or anything.

    i would like to set up nfs shares on my server.

    the shares will be username and password protected as they are in /mnt/storage/shared-folder

    as i go to my parents house alot i would like to be able to connect to my nfs shares using the windows file explorer on my mums windows 10 laptop.

    it would be nice if i could use a dyn-dns or something to get a connection, while this may not be secure but it seems easier and a lot less complicated than open vpn,

    im not sure if my mums xbox one could connect to the vpn as i have to put the certificate key thing on the devices that connect to the vpn

    im running

    Code:
    kde plasma 5.10.5
    kde framework 5.38.0
    qt version 5.9.1
    kernel 4.13.0-36-generic
    
    32bit os
    any help you can give me is most appreciated.

    ATB, Yoda

    Sent from my WAS-LX1A using Tapatalk
    Tutorials:
    Yoda's ownCloud Installation on Kubuntu 20.04

    #2
    i was just thinking KDE is a bit of a resource hog its a little laggy so i was thinking of trying a lightweight desktop can anyone give me some recommendations please bare in mind i must be able to configure the system settings via gui.

    i was wondering if webmin or something similar is available to help me manage my nfs shares

    Sent from my WAS-LX1A using Tapatalk
    Tutorials:
    Yoda's ownCloud Installation on Kubuntu 20.04

    Comment


      #3
      i was just doing some reading into nfs shares apparently i have to know the ip of the machine wanting to access the media this poses a problem my mums ip is dynamic and it would be to much effort to reconfigure her network and id have to leias with her isp [emoji22] is there any way to over come this?

      Sent from my WAS-LX1A using Tapatalk
      Tutorials:
      Yoda's ownCloud Installation on Kubuntu 20.04

      Comment


        #4
        No GUI to configure NFS that I know of.

        Re. dynamic IP: On a local network (not over the internet) you can use hostnames to mount NFS shares. If you're talking about over the internet, that can be done through a service like No-IP.com.

        Please Read Me

        Comment


          #5
          Originally posted by oshunluvr View Post
          No GUI to configure NFS that I know of.

          Re. dynamic IP: On a local network (not over the internet) you can use hostnames to mount NFS shares. If you're talking about over the internet, that can be done through a service like No-IP.com.
          if i understand correctly it can be done im just not sure of how to configure nfs for wat i need its a tad confusing

          Sent from my WAS-LX1A using Tapatalk
          Tutorials:
          Yoda's ownCloud Installation on Kubuntu 20.04

          Comment


            #6
            daft question but would webmin be of any use to me

            Sent from my WAS-LX1A using Tapatalk
            Tutorials:
            Yoda's ownCloud Installation on Kubuntu 20.04

            Comment


              #7
              Originally posted by hightokeinyoda View Post
              daft question but would webmin be of any use to me

              Sent from my WAS-LX1A using Tapatalk
              Webmin has some ability to configure NFS but not sure how much. Honestly, it would only take 5 minutes to do it from the command line. NFSv4 only requires a single export and it automatically exports all folders under the primary export folder. There's a ton of how-to's on the 'net but basically;

              Server:
              1. Install nfs-common on client and server PCs and nfs-kernel-server on the server
              2. Create a primary mount point for exporting
              3. (Optional) Create folders within the primary mount point for exporting other server folders.
              4. Create /etc/exports with the primary folder exported.

              Clients:
              1. Create mount point to mount the NFS share to.
              2. Create the mount entry in /etc/fstab.
              3. Mount the export.

              My setup is like this:

              Server:
              Exported folder is /exports/
              Inside /exports/ are other folders like: Documents, Pictures, Videos, etc. I mount server storage locations to these folders.
              The /etc/exports file contains:
              Code:
              [FONT=monospace][COLOR=#000000]/exports 192.168.1.0/24(rw,fsid=0,crossmnt,no_subtree_check,async,secure,nohide,all_squash,anonuid=65534,anongid=560)[/COLOR][/FONT]

              Clients:
              Mount point for the NFS share is /shared
              The /etc/fstab file contains:
              Code:
              [FONT=monospace][COLOR=#000000]server:/  /shared nfs auto,bg,soft,timeo=50,retrans=5,actimeo=10,retry=5,intr,users,rsize=131072,wsize=131072,noatime,nodiratime,x-systemd.automount 0 0[/COLOR][/FONT]

              So on my client when you look in /shared you see all the files and folders from the server that are under /exports and all the mounted folders too. I then delete the default "Public" folder in everyone's home folder and replace it with a symlink to /shared and name it "Public". To the users, it looks normal, but they're using the server when they access their Public folder. Easy-peasy.

              You should look up all the different options I'm using, but the primary functions are obvious. I use a special group I made called "share" and add that group to privileged users. NFS server maps every file to user 65534 (nobody) and group 560 (share) so all files are accessible by everyone. You can do yours differently if you wish.

              Please Read Me

              Comment


                #8
                Originally posted by oshunluvr View Post
                Webmin has some ability to configure NFS but not sure how much. Honestly, it would only take 5 minutes to do it from the command line. NFSv4 only requires a single export and it automatically exports all folders under the primary export folder. There's a ton of how-to's on the 'net but basically;

                Server:
                1. Install nfs-common on client and server PCs and nfs-kernel-server on the server
                2. Create a primary mount point for exporting
                3. (Optional) Create folders within the primary mount point for exporting other server folders.
                4. Create /etc/exports with the primary folder exported.

                Clients:
                1. Create mount point to mount the NFS share to.
                2. Create the mount entry in /etc/fstab.
                3. Mount the export.

                My setup is like this:

                Server:
                Exported folder is /exports/
                Inside /exports/ are other folders like: Documents, Pictures, Videos, etc. I mount server storage locations to these folders.
                The /etc/exports file contains:
                Code:
                [FONT=monospace][COLOR=#000000]/exports 192.168.1.0/24(rw,fsid=0,crossmnt,no_subtree_check,async,secure,nohide,all_squash,anonuid=65534,anongid=560)[/COLOR][/FONT]

                Clients:
                Mount point for the NFS share is /shared
                The /etc/fstab file contains:
                Code:
                [FONT=monospace][COLOR=#000000]server:/  /shared nfs auto,bg,soft,timeo=50,retrans=5,actimeo=10,retry=5,intr,users,rsize=131072,wsize=131072,noatime,nodiratime,x-systemd.automount 0 0[/COLOR][/FONT]

                So on my client when you look in /shared you see all the files and folders from the server that are under /exports and all the mounted folders too. I then delete the default "Public" folder in everyone's home folder and replace it with a symlink to /shared and name it "Public". To the users, it looks normal, but they're using the server when they access their Public folder. Easy-peasy.

                You should look up all the different options I'm using, but the primary functions are obvious. I use a special group I made called "share" and add that group to privileged users. NFS server maps every file to user 65534 (nobody) and group 560 (share) so all files are accessible by everyone. You can do yours differently if you wish.
                so basically if my exports file is like this
                Code:
                /exports myserverip/24(rw,fsid=0,crossmnt,no_subtree_check,async,secure,nohide,all_squash,anonuid=65534,anongid=560
                will share to my local network

                im assuming i can make a group using mk usrgroup share

                but how do i add it to the privileged user group?

                Sent from my WAS-LX1A using Tapatalk
                Tutorials:
                Yoda's ownCloud Installation on Kubuntu 20.04

                Comment


                  #9
                  one last question but how do i create the symlinks between my /etc/share folders and the source folders which are located on /mnt/storage

                  and my /etc/export file doesn't seem to exist
                  Sent from my WAS-LX1A using Tapatalk
                  Last edited by hightokeinyoda; Mar 08, 2018, 03:44 PM.
                  Tutorials:
                  Yoda's ownCloud Installation on Kubuntu 20.04

                  Comment


                    #10
                    The IP in the exports file on the server is to restrict network access to the share. My local network is 192.168.1. and the 0/24 means all computers on that network. My server IP is 192.168.1.199 and all the clients are 192.168.1.something. You can have a range or even a single IP in exports. Like you could export a folder to a single client or smaller group of clients rather than your entire network. This is useful if you have friends that use your network via wireless but you don't want them on your server. Then you would reduce the IP range and make sure your guest wifi network used IPs outside the allowed range.

                    The user and group id's and folder/file permissions on the server allow or restrict file level access for your clients. If users "dad" and "mom" are not re-mapped to a single user, then "mom" can't edit (delete) a file owned by "dad" and vice-versa. If they are re-mapped to a single user then all access is to everyone. The group access helps control this too. The export options I use force everyone to the same user and group. You may not want to do that. You can retain ownership of a file but allow limited access by sharing a group ID. Ubuntu type distros default to a individual group for each user so "dad" is user "dad" and his primary group is "dad". Other distros use "user" as a primary group so everyone can access any file in a public location. You can do all this any way that work's for you. I didn't see the need to prevent my wife from being able to delete a picture I put in the shared location, but you may not want your Mom deleting your stuff.

                    To make a group named "share":
                    sudo groupadd share

                    If you want to specific a "system" group, and the "-r" option:
                    sudo groupadd -r share

                    The difference is user groups are 1000 and above and system groups are 999 and below. It will pick an available group number automatically. If you want to specify a group number, add the "-g" option and a number. I used 560 so my groupadd command looked like:
                    sudo groupadd -g 560 share

                    Then add the users you want to have access to the shared file to the group. I went one step further, since I download files directly to my server in various ways, I made the shared locations have a "stickybit" that forces all files copied into the shared folders to change to group 560 (share). This is done by doing a "chmod" to the folder and adding "g+s" to the folder permissions or using octal permission starting with 2, like "2775" for the folder. This ensures that users can access downloaded files.

                    Please Read Me

                    Comment


                      #11
                      Originally posted by hightokeinyoda View Post
                      one last question but how do i create the symlinks between my /etc/share folders and the source folders which are located on /mnt/storage

                      and my /etc/export file doesn't seem to exist
                      Sent from my WAS-LX1A using Tapatalk
                      symlinks need to be owned by the user, but you make them like:

                      ln -s {source-folder} {symbolic-folder}

                      so your Mom's might be:

                      ln -s /mnt/storage /home/mom/Public



                      The file is "/etc/exports" not "/etc/export". The installation of nfs-kernel-common server should create a dummy file with comments in it, but if not, make one.
                      Last edited by oshunluvr; Mar 09, 2018, 06:50 AM.

                      Please Read Me

                      Comment


                        #12
                        i tried running sudo apt-get install nfs-kernel-common it tells me i cant find the package.

                        Sent from my WAS-LX1A using Tapatalk
                        Tutorials:
                        Yoda's ownCloud Installation on Kubuntu 20.04

                        Comment


                          #13
                          so ive created the /etc/share dir and populated it with folder Films TV and Music inside each folder i have created a basic link to their respective folders in /mnt/storage.

                          or is it best to have /etc/share/symlink

                          Sent from my WAS-LX1A using Tapatalk
                          Tutorials:
                          Yoda's ownCloud Installation on Kubuntu 20.04

                          Comment


                            #14
                            it appears a reinstall of nfs-kernel-server fixed the exports file problem

                            Sent from my WAS-LX1A using Tapatalk
                            Tutorials:
                            Yoda's ownCloud Installation on Kubuntu 20.04

                            Comment


                              #15
                              im just ready to test this but when i try to restart the nfs server it says
                              Code:
                               job for nfs-server.service canceled
                              Sent from my WAS-LX1A using Tapatalk
                              Last edited by hightokeinyoda; Mar 08, 2018, 05:18 PM.
                              Tutorials:
                              Yoda's ownCloud Installation on Kubuntu 20.04

                              Comment

                              Working...
                              X