read-write permission NFS server

I’m trying to mount a folder on a server using NFS and I want read-write permissions in that folder. As of now I am able to read, but not write. I’m running SUSE 11.1 - 64bit

Here is my client etc/fstab entry

server:/folder /folder nfs

Here is my server /etc/exports

/folder client(rw,sync)

To mount it manually on the client side, I use the command:

mount server:/folder /folder

I have also tried:

mount -o rw server:/folder /folder

I’ve restarted both computers but I still have only read permissions to /folder on the client machine.

Before I use the mount command, I can create files on the client in /folder

After running the mount command, permission is denied.

Both computers are logged in as root.

Any ideas?

I have found that the easiest way to configure nfs is through yast.
On the server machine do the following

  1. install yast2-nfs-server via install software.
  2. goto yast > Network Services > NFS Server
  3. Under NFS Server click the radio button start.
  4. Click “add directory” and select desired directory to export.
    5.Under options make sure you change the ro to rw. So the string looks similar to this “rw,root_squash,sync,no_subtree_check”
  5. Click “OK” and then click “finish”

On the client machine do the following.
1.goto yast > Network Services > NFS Client
2.click “add”
3.enter the ip address of the server computer
4.enter the remote directory that you configured above. Remember it is an absolute path. So, I am sharing /mnt/MYTH on the server and I mount it in the same way on my client computers ie /mnt/MYTH.
5.Select the directory where you want to mount the remote directory on the local machine.
6. leave options set to “defaults”.

now you should gain full access to the remote directory. Hope that helps.

The root account is normally mapped to an account with no privileges on remote filesystems for security reasons. You should use the remote filesystems as yourself. The account ids should be made the same numbers both systems.

you have to share the folder with the write permission in the server. I mean right click the folder and go to properties and under share tab give the write permission.

You must have missed it when you read the man page for exports. ken_yap was correct.

Do the following in /etc/exports:

/folder client(rw,sync,no_root_squash)

Do a “man 5 exports” for the details.

It works now.

/folder client(rw,sync,no_root_squash)

Thanks guys.

If you decide to use no_root_squash be sure you trust the client. Otherwise if you can be root on the client and have a normal login on the server, this way of becoming on the server is possible:

Assume /folder is exported from the server. On the client:

# cp /bin/bash /folder/myrootsh
# chmod u+s /folder/myrootsh

On the server:

$ /folder/myrootsh
# 

Voila, root!