I have a strange problem. I am using Ubuntu 14.04 and an NFS home folder, and currently if i try to log in i get thrown back to the loginscreen
I have a NAS, and the home directory is located there. I mount the NAS via NFS at my fstab like this:
157.181.240.65:/dlab /dlab nfs defaults 0 0After that i modified my /etc/passwd file to point the home directory to a folder on my mounted NAS like this:
gerdos:x:1003:1020:Erdos Gabor,,,:/dlab/home/gerdos:/bin/bashI created every file on the NAS with the same 1003 USERID and 1020 GRPID
Now after a recent update via apt-get i am unable to log into a graphical user interface (gnome flashback compiz).
I think some permissions are bad. I cant really use sudo on files in my home directory, even i clearly have a permission.
A strange one for example:
nano ~/asd # --> No problem, can nano it perfectly,
sudo nano ~/asd # --> Error reading /dlab/home/gerdos/.nano_history: Permission deniedStrange. Permissions on ~/.nano_history:
-rw------- 1 gerdos dlab 39 Feb 23 10:51 .nano_historyIt is clear that i have read and write permissions, but sudo does not. I guess the problem might come from somewhere here, that i cant log in.
If i change the permission to 755 sudo still cant read it. On 777 it can. I would like to avoid putting all my files to 777.
How can i solve this problem? How can i "combine" the sudo on the NAS and on my CPU to work together? Is this causing the problem that i can login?
31 Answer
That's a feature of NFS. Since NFS packets are not authenticated (they just say UID=x,GID=y, trust me), any NFS packets claiming to be from root (UID=0, GID=0) are remapped to nobody, a userid/groupid with NO privileges:
$ grep nobody /etc/passwd
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologinThe other choice (A Very Bad Idea) is to believe the UID=0 in the NFS packet from Some Other System, and grant it root access to the NFS server/NAS. DO NOT DO THIS.