Post by William A. (Andy) AdamsonYou always need to have UID/GID mapping on the client be the same as
on the server if you want ls -l on the client to Just Work. Run LDAP (
As far as I can see, you don't. Here's my test:
On the server, there's users "valentyn" with uid 1000, and testuser1, 2
and 3 with uids 1001, 1002 and 1003, and a user that we will sync on
client and server, called "correctid":
root at server:/home# for a in valentyn testuser{1,2,3} correctid; do id
$a; done
uid=1000(valentyn) gid=1000(valentyn) groepen=1000(valentyn)
uid=1001(testuser1) gid=1001(testuser1) groepen=1001(testuser1)
uid=1002(testuser2) gid=1002(testuser2) groepen=1002(testuser2)
uid=1003(testuser3) gid=1003(testuser3) groepen=1003(testuser3)
uid=1004(correctid) gid=1004(correctid) groepen=1004(correctid)
root at server:/home# ls -l
totaal 20
drwxr-xr-x 2 correctid correctid 4096 2010-03-03 11:33 correctid
drwxr-xr-x 23 testuser1 testuser1 4096 2010-03-03 11:31 testuser1
drwxr-xr-x 2 testuser2 testuser2 4096 2010-03-03 11:26 testuser2
drwxr-xr-x 2 testuser3 testuser3 4096 2010-03-03 09:56 testuser3
drwx------ 24 valentyn valentyn 4096 2010-02-24 13:41 valentyn
To make sure everything is as we expect it to be:
root at server:/home# ls -ln
totaal 20
drwxr-xr-x 2 1004 1004 4096 2010-03-03 11:33 correctid
drwxr-xr-x 23 1001 1001 4096 2010-03-03 11:31 testuser1
drwxr-xr-x 2 1002 1002 4096 2010-03-03 11:26 testuser2
drwxr-xr-x 2 1003 1003 4096 2010-03-03 09:56 testuser3
drwx------ 24 1000 1000 4096 2010-02-24 13:41 valentyn
On the client, I'm using the same usernames, but different uids; I used
"valentijn" instead of "valentyn" and I added the correctid user:
root at client:~# for a in valentyn valentijn testuser{1,2,3} correctid; do
id $a; done
id: valentyn: No such user
uid=1002(valentijn) gid=1002(valentijn) groups=1002(valentijn)
uid=1000(testuser1) gid=1000(testuser1) groups=1000(testuser1)
uid=1003(testuser2) gid=1003(testuser2) groups=1003(testuser2)
uid=1001(testuser3) gid=1001(testuser3) groups=1001(testuser3)
uid=1004(correctid) gid=1004(correctid) groups=1004(correctid)
root at client:~# mount|grep home
server:/home on /home type nfs4
(rw,sec=krb5,clientaddr=192.168.203.98,addr=192.168.203.10)
testuser2 at client:~$ ls -l /home/
totaal 20
drwxr-xr-x 2 correctid correctid 4096 2010-03-03 11:33 correctid
drwxr-xr-x 23 testuser1 testuser1 4096 2010-03-03 11:45 testuser1
drwxr-xr-x 2 testuser2 testuser2 4096 2010-03-03 11:26 testuser2
drwxr-xr-x 2 testuser3 testuser3 4096 2010-03-03 09:56 testuser3
drwx------ 24 nobody nogroup 4096 2010-02-24 13:41 valentyn
testuser2 at client:~$ ls -ln /home/
totaal 20
drwxr-xr-x 2 1004 1004 4096 2010-03-03 11:33 correctid
drwxr-xr-x 23 1000 1000 4096 2010-03-03 11:45 testuser1
drwxr-xr-x 2 1003 1003 4096 2010-03-03 11:26 testuser2
drwxr-xr-x 2 1001 1001 4096 2010-03-03 09:56 testuser3
drwx------ 24 65534 65534 4096 2010-02-24 13:41 valentyn
Please note, that there is stupid tricks to confuse the heck out of
anyone (if the above is not enough already ;)
For example, if you happen to know someone else's password, you can use
"kinit someoneelse" on the client. This will tell the server that your
uid-number coming from this client is essentially equal to someoneelse
on the server. Due to credentials caching you can't seem to correct
this. Here we show testuser3 getting the "valentyn" principal and
changing al my files, then being unable to change his own files:
su - testuser3 # and please note, testuser3 does not have a ticket yet,
# so he can't read his home directory:
No directory, logging in with HOME=/
testuser3 at host98:/$ kinit valentyn
valentyn at KANTOOR.OFFICE.BUREAU's Password:
testuser3 at host98:/$ cd /home/valentyn/
testuser3 at host98:/home/valentyn$ touch I-am-you
testuser3 at host98:/home/valentyn$ whoami
testuser3
All right. Now testuser3 regrets and tries to get his own identity back
- but he can't!
$ kinit testuser3
testuser3 at KANTOOR.OFFICE.BUREAU's Password:
testuser3 at host98:/home/valentyn$ klist
Credentials cache: FILE:/tmp/krb5cc_1001
Principal: testuser3 at KANTOOR.OFFICE.BUREAU
Issued Expires Principal
Mar 3 11:59:17 Mar 3 21:59:17
krbtgt/KANTOOR.OFFICE.BUREAU at KANTOOR.OFFICE.BUREAU
testuser3 at host98:/home/valentyn$ touch I-am-still-you
testuser3 at host98:/home/valentyn$ cd /home/testuser3/
testuser3 at host98:/home/testuser3$ touch I-am-not-I
touch: cannot touch `I-am-not-I': Permission denied
testuser3 at host98:/home/testuser3$ ls -al
total 20
drwxr-xr-x 2 testuser3 testuser3 4096 Mar 3 09:56 .
As you can see, uid 1001 is mapped to uid 1000 on the server, no matter
what we do. (Does this have a timeout? Does anyone know?)
Anyway, that doesn't have anything to do with idmapd.
I'd be glad to send more information about the configuration used; if
anyone has comments, please say so. As I have seen that an error is
easily made during testing (at first, I did not even have the NFS dir
mounted and I was almost crying victory, when I noted my stupid
mistake), so please send comments/questions.
Best regards,
Valentijn