# nfs mount with write permissions?

## Utoxin

How do I set up an nfs mount so that a non-root user can have rw access to it?

Here's my current /etc/fstab for the client, and /etc/exports for the server.

```

# /etc/fstab: static file system information.

#

# noatime turns of atimes for increased performance (atimes normally aren't

# needed; notail increases performance of ReiserFS (at the expense of storage

# efficiency).  It's safe to drop the noatime options if you want and to 

# switch between notail and tail freely.

# <fs>             <mountpoint>    <type>     <opts>            <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

/dev/hda2         /boot      ext2      noauto,noatime      1 1

/dev/hda4         /      xfs      noatime         0 0

/dev/hda3         none      swap      sw         0 0

/dev/cdroms/cdrom0      /mnt/cdrom   iso9660      noauto,ro,user      0 0

proc            /proc      proc      defaults      0 0

/dev/hdb2         /mnt/shared   vfat      defaults      0 0

fake-address.com:/var/www   /mnt/web-devel   nfs      rsize=8192,wsize=8192,timeo=14,intr,user

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for

# POSIX shared memory (shm_open, shm_unlink). Adding the following

# line to /etc/fstab should take care of this:

# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will use almost no

#  memory if not populated with files)

tmpfs         /dev/shm   tmpfs      defaults      0 0

```

```

/var/www   host.fake-address.com(rw)

```

----------

## Utoxin

Just a note, I tried changing my /etc/exports to this, based on the man pages, and it didn't change anything.

```

/var/www   host.fake-address.com(rw,all_squash,anonuid=500,anongid=500)

```

----------

## squanto

you need the rw tag along with the rsize and wsize section

see if that helps ya out.

Andrew

----------

## Utoxin

Nope. No change.

----------

## squanto

on boot, does the nfs files system mount on your client?

and can you get into and look around the mounted file system as root?

can you atleast see how big the mounted file system is? if so, then it is mounting correctly, it is just not set up right.

if so, it is just probably a user permissions deal.  Check the owner and permissions, just make a new group and add root and the users that will be able to access this to the group and make the directory that the nfs is mounted under be owned by this new group.

Does that help at all?

also check out : http://www.tldp.org/HOWTO/NFS-HOWTO/server.html

that is where I figured out most of the stuff for my nfs, but also from my other post on gentoo board.

----------

## Utoxin

It is mounting. It's just mounting read only. Even though 'cat /proc/mounts' shows it as being mounted rw.

And changing the group permissions on the directory had no effect. In fact, it reset them when I did the mount.

----------

## squanto

do the users that are trying to access the mounted directory have rw permissions on the server?

if they do, then I am kind of stumped.  I don't have all that much experience with nfs, just what I know from getting my little one user setup going which was pretty painless.

If you are running Xwindows, you may want to look into menuconfig, you can configure most anything on your server with it fairly painlessly.

----------

## Utoxin

Where would I get info about 'menuconfig'?

----------

## squanto

I am an idoit, it isn't called menuconfig, that is for kernel, I have been doing too much work for school and not enough sleep. 

The thing I ment to tell you about is webmin.

Info about it can be found here :

http://www.webmin.com/webmin/

It is pretty cool, it will run a web server on port 10000 if I remember correctly and you have to have apache installed.  But other than that, I think it is pretty straight forward.

Sorry bout getting the names wrong.

-Andrew

----------

## Utoxin

Oops. Never got back to this. I did get it fixed. Turns out you /have/ to have the same UID on both machines. User /name/ doesn't matter. Once I did that, it worked great.

----------

