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

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

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

##SERVER SIDE##
1. On server side must have the insecure option enabled edit /etc/exports
/exports/real 192.17.36.147/255.255.255.255(rw,nohide,insecure,no_subtree_check,sync)
2. Make the change
exportfs -ra
3. Make sure it is running
rpcinfo -p | grep portmap
showmount

## CLIENTE SIDE ##

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
[Mapping]
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

NOTES:
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:
/etc/nfsmount.conf

Categories: Linux Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.

VAMOVE *

*