-1

I have 10 systems with opensuse installed in each of them.I have created 2 servers such that one is NIS and other is NFS , i have added lets say 5 users to NIS and their corresponding home directories were rsynced to second system (NFS). NOw i want to write a script that can delete the user and also delete corresponding NFS located home folder.

I tried userdel but it was unable to delete directory from NFS

Mt /etc/exports of NFS server is

homescis *(fsid=0,crossmnt,rw,root_squash,sync,no_subtree_check)
user229534
  • 154
  • 3
  • The issue here is probably not `usermod`, but the permissions with which the file system is exported - specifically, how the server treats requests that originate from root-owned client processes). If this is so, no script is going to be able to do what you want. Could you cut-and-paste into the question the relevant line in `/etc/exports` on the NFS server? – MadHatter Jul 07 '14 at 06:31
  • homescis *(fsid=0,crossmnt,rw,root_squash,sync,no_subtree_check) – user229534 Jul 07 '14 at 06:45

1 Answers1

0

On the server, change root_squash to no_root_squash and do an exportfs -av. That is causing requests issued by root on the client to be interpreted without privilege on the server; if you want tools like usermod to run, root privilege is needed on the /home filesystem.

MadHatter
  • 78,442
  • 20
  • 178
  • 229