2

I am adding users using the command useradd in opensuse 12.1 and creating a home directory on NFS. The problem here is the home directory's owner is root instead of user.

msvlsi67:~ # useradd -g users -d /export/home/raj67 -m raj67
useradd: Warning: chown on `/export/home/raj67' failed: Invalid argument
Cannot change owner/group for `/export/home/raj67': Invalid argument
Cannot change permissions for `/export/home/raj67/.emacs': Invalid argument
Cannot change permissions for `/export/home/raj67/.bashrc': Invalid argument
Cannot change permissions for `/export/home/raj67/.inputrc': Invalid argument
Cannot change permissions for `/export/home/raj67/.xinitrc.template': Invalid argument
Cannot change permissions for `/export/home/raj67/bin': Invalid argument
Cannot change permissions for `/export/home/raj67/.local': Invalid argument
Cannot change permissions for `/export/home/raj67/.xim.template': Invalid argument
Cannot change permissions for `/export/home/raj67/.vimrc': Invalid argument
Cannot change permissions for `/export/home/raj67/.config': Invalid argument
Cannot change permissions for `/export/home/raj67/.bash_history': Invalid argument
Cannot change permissions for `/export/home/raj67/.fonts': Invalid argument
Cannot change permissions for `/export/home/raj67/.profile': Invalid argument
Cannot change permissions for `/export/home/raj67/public_html/.directory': Invalid argument
Cannot change permissions for `/export/home/raj67/public_html': Invalid argument
useradd: Copying of skel directory failed.
msvlsi67:/export/home # ll |grep raj67
drwxr-xr-x  2 root  root   4096 Apr 12  2012 raj67 
msvlsi67:/export/home # 

I tried adding users using the GUI but still the owner is root. using chown for home directory also gave the same error.

Could anyone please help in fixing this issue?

Thank you.

user1291759
  • 141
  • 1
  • 2
  • 4
  • Please provide the export line on the server side for your share, and your mount command or fstab line on the client side. – Peter Apr 12 '12 at 14:17
  • @Peter The /etc/exports file /export 192.168.1.10*(rw,no_root_squash,async,no_subtree_check) client fstab entry /export 192.168.1.10*(rw,no_root_squash,async,no_subtree_check) –  Apr 12 '12 at 14:43
  • What is the filesystem of the export? Also, can you manually create a folder as root and modify the permissions? – WerkkreW Apr 12 '12 at 15:03
  • @WerkkreW: its on NFS. yes, I am able to change the permissions, but not the ownership. – user1291759 Apr 12 '12 at 15:28
  • Can you please edit the question to include the proper formatting for your /etc/exports file? It looks somewhat incorrect from what I can see. You most likely want to enable root squashing, unless you have a viable reason. – NcA Apr 12 '12 at 19:13

1 Answers1

1

It seems to me that a few things are the possible culprit. It appears that root on the client does not match root on the NFS server and is potentially disallowed from altering ownership of files either from a UID perspective or who owns /export on the NFS server.

The issue here has nothing to do with the useradd command itself because as you stated in the comments you cannot chown files/folders from the client on the export at all. This can be due to the way it was exported, a UID/GID mismatch, or how the ownership of the folder is set up on the server side.

As I previously mentioned you can check the permissions of the folder server-side, and look for UID/GID mismatches and make sure the ownership of the exported folder is correct. Be sure to re-export the folder and re-mount it any time you change a setting to ensure it takes effect. You may also consider setting anonuid=0,anongid=0.

One last thing is that if you are using NFSv4 try it using NFSv3 to see if the problem happens there (nfsvers=3).

A lot of OpenSuse specific troubleshooting information on this very topic is in a thread I found here on the opensuse forums, although they did not appear to resolve the issue.

WerkkreW
  • 5,879
  • 3
  • 23
  • 32