Announcement

Collapse
No announcement yet.

NFS - executing scripts and NFS4

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

    NFS - executing scripts and NFS4

    I've just about got the new computer fully setup. 2 questions on NFS

    In fstab I've been using nfs4 to specify the fileype. Is that necessary or is just plain nfs equivalent?

    On the laptop, I I want to be able to execute a script on the desktop. The laptop has access to the file and it is set as executable on the desktop. When I specify the filename on the laptop, I get permission denied. I guess that nfs does not permit executing a script file on the connected computur. Correct?

    I tried using ssh a few years back but was never able to get it working. Since either computer hangs when the other computer is shutdown if I don't unmount the shared folders first, I tried using ssh to execute a script on the other computer to unmount all shared folders. Never could get the scripts (or ssh?) to work.

    #2
    nfs4 vs. nfs3 - IMO, for home use i doesn't matter much. Kubuntu can do both versions, you only need both the server and the client using the same version of exports and mounting.

    Re. your script, do "mount -v <mount point>" and look at how you're mounted. If you see "nosuid,nodev,noexec," you're not going to run a script that way.

    You can "loosen" up NFS security but it's actually safer and better to use ssh or rsh for this sort of thing. Not hard to set up and much easier to keep secure. I just type "rsh server <command>" and it does it or log in via ssh in a terminal for multiple commands and to see what's happening over on the other computer.

    The real slick trick is to generate keys for both computers then you don't even have to log in or enter a password to use ssh or rsh.

    Please Read Me

    Comment


      #3
      Also, use these options on your client-side mounts to speed up transfers.

      rsize=32768,wsize=32768,

      Please Read Me

      Comment


        #4
        Thanks for the headsup on the [rw]size options

        examined the [rw]size on both the desktop and the laptop:

        desktop: 262144
        laptop: 1048576

        Which seems large enough for most transfers.

        Trying to understand why I cannot execute a file on the desktop from the laptop. When I try, I get a error message that permission denied.

        I checked that the file is executable as listed on both computers.

        The fstab line on the laptop is: 192.168.1.6:/bin /home/Home-Net/bin nfs4 rw,users,exec,_netdev,auto 0 0

        The "exec" following the "users" should allow files to be executed. But when I examine the /proc/mounts

        192.168.1.6:/bin /home/Home-Net/bin nfs4 rw,nosuid,nodev,noexec,relatime,vers=4.0,rsize=104 8576,wsize=1048576,namlen=255,hard,proto=tcp,port= 0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1 .2,local_lock=none,addr=192.168.1.6 0 0

        which specifically disallows executing a file.

        reading the manual on mount for the "users" option:

        This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line user,exec,dev,suid).
        relevant fstab line: 192.168.1.6:/bin /home/Home-Net/bin nfs4 rw,users,exec,_netdev,auto 0 0

        So the "exec" following "users" should allow the execution of a file.

        Any ideas??

        Comment


          #5
          Curious, since you have it automounted anyway, if removing users option would fix it.

          Please Read Me

          Comment


            #6
            Okay - I finally found a web site that is very clear (at least to me) on how to set up ssh. Several years ago I tried setting up ssh since I thought it would be the better way to accomplish what I wanted. After many hours reading the manual pages and googling for web sites I just couldn't get it working. Don't know why. The manual pages I have found are great for refreshing my memory, but for learning something totally different and new - not so good for me. All of the web sites I found back then were written by experts. I found out in grad school that experts are usually not very good at explaining what is obvious to them and they usually have little patience for us mere mortals. I remember attending lectures by the top people in the field like, Murray Gellman, and wondering am I the only stupid person here? After looking around and seeing the puzzled looks on all of the faces - I realized that I wasn't. That's when I decided that I was glad that the powers that be had decided that I should a mere mortal and not a genius. Of course, I have since met many geniuses who are also mortals and they can be very fun to interact with.

            Anyway, this time when I searched with Google, I found a page that told how in two simple CLI commands to get ssh working between the desktop and the laptop connected with ethernet through the router:

            ssh-keygen

            and

            ssh-copy-id

            Using those two simple commands I now have ssh working on both.

            I remember reading about the second command in a tract written by one expert and my immediate thought was, "Do I execute the command on the desktop, the same computer as the 1st command, or the laptop?" Of course to the expert the answer was obvious and is pretty obvious to me now. But to the expert the question was so obvious they never even had the question arise in their head and so they gave no inkling as to the answer. So the tracts I was reading several years ago failed utterly in helping me.

            Now that I have ssh working, trying to execute scripts on the other computer using nfs is a moot point and I think that nfs is designed to prevent just such a thing. One manual page I read hinted at just that.

            I thank you for your help.

            Comment

            Working...
            X