How to create a shared folder using command line on a server

21,902

I don't think you can give the ~/uslonsweb003 as a directory it would have to be full eg /home/sadmicrowave/uslonsweb003 in fstab (because there may be more than one user)

this is your original

//128.251.xxx.xxx/var/ ~/uslonsweb003 nfs #username=[username],password=[password], 0 0

you don't need the // at the beginning or #username=[username],password=[password],

and after the nfs you should have your options giving you line like this

128.251.xxx.xxx:/var  /home/sadmicrowave/uslonsweb003  nfs rw,hard,intr 0 0

as the folder being shared is a root only folder (it acts exactly like it would on your own machine) you will need to open nautilus as root to be able to edit files.

You can find a list of nfs options and a description of what they do here.

Hope this helps

Share:
21,902
sadmicrowave
Author by

sadmicrowave

Updated on September 17, 2022

Comments

  • sadmicrowave
    sadmicrowave over 1 year

    After following the tutorial here I ran into a problem. Here is what I did.

    On my server I installed nfs-kernel-server and edited the /etc/exports file to include the folder I want to share:

     /var *(rw,sync)
    

    On my client machine I edited my fstab file to include share:

     //128.251.xxx.xxx/var/ ~/uslonsweb003 nfs #username=[username],password=[password], 0 0
    

    Entered command:

      sudo mount -a 
    

    which gives this error:

      mount.nfs: remote share not in 'host:dir' format
    

    Where did I go wrong with this setup?

    Also if there is a better way (using command line) to setup a folder share on an Ubuntu 10.10 server that will be accessed by other linux and windows machines please let me know.

    UPDATE:
    The mapped drive is now not letting me create,edit,delete files or folders (readonly access) my configuration is as follows:

    client fstab file:

     128.251.xxx.xxx:/var /home/coreyf/uslonsweb003 nfs rw,hard,intr, 0 0
    

    server exports file:

     /var *(rw,no_root_squash,sync,no_subtree_check)
    

    UPDATE 2:

    Using Allans solution my drive mounted correctly however after putting rw,intr as my additional parameters I cannot create, edit and delete folders/files.

  • sadmicrowave
    sadmicrowave about 13 years
    Ok, changed it, but still getting the same error