How to connect NFS with a specfic user under CentOS/RedHat 6

How to connect NFS with a specfic user under CentOS/RedHat 6

1. On server side must have the insecure option enabled edit /etc/exports
2. Make the change
exportfs -ra
3. Make sure it is running
rpcinfo -p | grep portmap


1. Install nfs-utils
yum install nfs-utils.x86_64

2. Start portmap/rpcbind
service portmap start
service rcpbind start

3. test if you can get to the server
showmount -e

4. mount with any user just to test first
mount -v server1:/exports/real /mnt/real/

Criar o usuario local com mesmo UID do que ta no servidor NFS
5. Create local usear with same UID as of the NFS server
useradd -u 8888 escenic

6. Add user/group info into idmapd edit /etc/idmapd.conf
Nobody-User = escenic
Nobody-Group = escenic

7. Create the directory and set correct permissions
mkdir /mnt/real
chown escenic.escenic -R /mnt/real

8. Try mount now via /etc/fstab passing the correct args
server1:/exports/real /mnt/real/ nfs auto,nolock,proto=tcp,rw,hard,intr,bg,rsize=32768,wsize=32768 0 0

9. Mount and make sure its there
mount -v -a
mount -l

10. Test read/write with specified account

Verify the firewall rules as well, iptables -L -n
If you want portmapper and nfs to start everytime at startup then as root:
chkconfig portmap on
chkconfig rpcbind on
Other config files:

Leave a Reply

Your email address will not be published. Required fields are marked *