summaryrefslogtreecommitdiff
path: root/usr/src/man/man1m/idmap.1m
blob: 7854c02708c032ae9d242210a3ddae3cc871eab9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the
.\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH IDMAP 1M "Aug 3, 2009"
.SH NAME
idmap \- configure and manage the Native Identity Mapping service
.SH SYNOPSIS
.LP
.nf
\fBidmap\fR
.fi

.LP
.nf
\fBidmap\fR \fB-f\fR \fIcommand-file\fR
.fi

.LP
.nf
\fBidmap\fR add [\fB-d\fR] \fIname1\fR \fIname2\fR
.fi

.LP
.nf
\fBidmap\fR dump [\fB-n\fR] [\fB-v\fR]
.fi

.LP
.nf
\fBidmap\fR export [\fB-f\fR \fIfile\fR] \fIformat\fR
.fi

.LP
.nf
\fBidmap\fR get-namemap \fIname\fR
.fi

.LP
.nf
\fBidmap\fR help
.fi

.LP
.nf
\fBidmap\fR import [\fB-F\fR] [\fB-f\fR \fIfile\fR] \fIformat\fR
.fi

.LP
.nf
\fBidmap\fR list
.fi

.LP
.nf
\fBidmap\fR remove [\fB-t\fR|\fB-f\fR] \fIname\fR
.fi

.LP
.nf
\fBidmap\fR remove \fB-a\fR
.fi

.LP
.nf
\fBidmap\fR remove [\fB-d\fR] \fIname1\fR \fIname2\fR
.fi

.LP
.nf
\fBidmap\fR set-namemap [\fB-a\fR \fIauthenticationMethod\fR] [\fB-D\fR \fIbindDN\fR]
     [\fB-j\fR \fIpasswdfile\fR] \fIname1\fR \fIname2\fR
.fi

.LP
.nf
\fBidmap\fR show [\fB-c\fR] [\fB-v\fR] \fIidentity\fR [\fItarget-type\fR]
.fi

.LP
.nf
\fBidmap\fR unset-namemap [\fB-a\fR \fIauthenticationMethod\fR] [\fB-D\fR \fIbindDN\fR]
     [\fB-j\fR \fIpasswdfile\fR] \fIname\fR [\fItarget-type\fR]
.fi

.SH DESCRIPTION
.sp
.LP
The \fBidmap\fR utility is used to configure and manage the Native Identity
Mapping service.
.sp
.LP
The Native Identity Mapping service supports the following types of mappings
between Windows security identities (SIDs) and POSIX user IDs and group IDs
(UIDs and GIDs):
.RS +4
.TP
.ie t \(bu
.el o
\fBName-based mapping.\fR An administrator maps Windows and UNIX users and
groups by name.
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fBEphemeral ID mapping.\fR A UID or GID is dynamically allocated for every SID
that is not already mapped by name.
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fBLocal-SID mapping.\fR A non-ephemeral UID or GID is mapped to an
algorithmically generated local SID.
.RE
.sp
.LP
The \fBidmap\fR utility can be used to create and manage the name-based
mappings and to monitor the mappings in effect.
.sp
.LP
If the \fBidmap\fR utility is invoked without a subcommand or option, it reads
the subcommands from standard input. When standard input is a TTY, the
\fBidmap\fR command prints the usage message and exits.
.SS "Mapping Mechanisms"
.sp
.LP
The \fBidmapd\fR(1M) daemon maps Windows user and group SIDs to UNIX UIDs and
GIDs as follows:
.RS +4
.TP
1.
SIDs are mapped by name.
.sp
This mapping uses the name-based mappings that are manually set up by the
system administrator.
.RE
.RS +4
.TP
2.
If no name-based mapping is found, the SID is mapped to a dynamically
allocated ephemeral ID.
.sp
This allocation uses the next available UID or GID from 2^31 to 2^32 - 2.
.RE
.sp
.LP
Local SID mappings are used to map from UNIX to Windows.
.sp
.LP
To prevent aliasing problems, all file systems, archive and backup formats, and
protocols must store SIDs or map all UIDs and GIDs in the 2^31 to 2^32 - 2
range to the \fBnobody\fR user and group.
.sp
.LP
It is possible to create also diagonal mappings. They are the mappings between
Windows groups and Solaris users and between Solaris groups and Windows users.
They are needed when Windows uses a group identity as a file owner or vice
versa.
.SS "Name-based Mappings"
.sp
.LP
Name-based mappings establish name equivalence between Windows users and groups
and their counterparts in the UNIX name service. These mappings persist across
reboots. For example, the following command maps Windows users to UNIX users
with the same name:
.sp
.in +2
.nf
# \fBidmap add "winuser:*@mywindomain.com" "unixuser:*"\fR
.fi
.in -2
.sp

.sp
.LP
If configured to use a directory service, \fBidmapd\fR(1M) will first try to
use the mapping information that is stored in user or group objects in the
Active Directory (AD) and/or the native LDAP directory service. For example, an
AD object for a given Windows user or group can be augmented to include the
corresponding Solaris user or group name or numeric id. Similarly, the native
LDAP object for a given Solaris user or group can be augmented to include the
corresponding Windows user or group name.
.sp
.LP
\fBidmapd\fR(1M) can be configured to use AD and/or native LDAP directory-based
name mappings by setting the appropriate service management facility (SMF)
properties of the \fBidmap\fR service. See "Service Properties," below, for
more details.
.sp
.LP
If directory-based name mapping is not configured or if configured but not
found, then \fBidmapd\fR(1M) will process locally stored name-based mapping
rules.
.sp
.LP
\fBidmap\fR supports the mapping of Windows well-known names. A few of these
are listed below:
.sp
.in +2
.nf
Administrator
Guest
KRBTGT
Domain Admins
Domain Users
Domain Guest
Domain Computers
Domain Controllers
.fi
.in -2
.sp

.sp
.LP
When \fBidmap\fR rules are added, these well-known names will be expanded to
canonical form. That is, either the default domain name will be added (for
names that are not well-known) or an appropriate built-in domain name will be
added. Depending on the particular well-known name, this domain name might be
null, \fBBUILTIN\fR, or the local host name.
.sp
.LP
The following sequence of \fBidmap\fR commands illustrate the treatment of the
non-well-known name \fBfred\fR and the well-known names \fBadministrator\fR and
\fBguest\fR.
.sp
.in +2
.nf
# \fBidmap add winname:fred unixuser:fredf\fR
add     winname:fred    unixuser:fredf

# \fBidmap add winname:administrator unixuser:root\fR
add     winname:administrator   unixuser:root

# \fBidmap add winname:guest unixuser:nobody\fR
add     winname:guest   unixuser:nobody

# \fBidmap add wingroup:administrators sysadmin\fR
add     wingroup:administrators unixgroup:sysadmin

# \fBidmap list\fR
add     winname:Administrator@examplehost  unixuser:root
add     winname:Guest@examplehost  unixuser:nobody
add     wingroup:Administrators@BUILTIN unixgroup:sysadmin
add     winname:fred@example.com       unixuser:fredf
.fi
.in -2
.sp

.SS "Ephemeral Mappings"
.sp
.LP
The \fBidmapd\fR daemon attempts to preserve ephemeral ID mappings across
daemon restarts. However, when IDs cannot be preserved, the daemon maps each
previously mapped SID to a new ephemeral UID or GID value. The daemon will
never re-use ephemeral UIDs or GIDs. If the \fBidmapd\fR daemon runs out of
ephemeral UIDs and GIDs, it returns an error as well as a default UID or GID
for SIDs that cannot be mapped by name.
.sp
.LP
The dynamic ID mappings are not retained across reboots. So, any SIDs that are
dynamically mapped to UNIX UIDs or GIDs are most likely mapped to different IDs
after rebooting the system.
.SS "Local SID Mappings"
.sp
.LP
If no name-based mapping is found, a non-ephemeral UID or GID is mapped to an
algorithmically generated local SID. The mapping is generated as follows:
.sp
.in +2
.nf
local SID for UID = \fI<machine SID>\fR - \fI<1000 + UID>\fR
local SID for GID = \fI<machine SID>\fR - \fI<2^31 + GID>\fR
.fi
.in -2
.sp

.sp
.LP
\fI<machine SID>\fR is a unique SID generated by the \fBidmap\fR service for
the host on which it runs.
.SS "Rule Lookup Order"
.sp
.LP
When mapping a Windows name to a UNIX name, lookup for name-based mapping rules
is performed in the following order:
.RS +4
.TP
1.
\fIwindows-name\fR\fB@\fR\fIdomain\fR to \fB""\fR
.RE
.RS +4
.TP
2.
\fIwindows-name\fR\fB@\fR\fIdomain\fR to \fIunix-name\fR
.RE
.RS +4
.TP
3.
\fIwindows-name\fR\fB@*\fR to \fB""\fR
.RE
.RS +4
.TP
4.
\fIwindows-name\fR\fB@*\fR to \fIunix-name\fR
.RE
.RS +4
.TP
5.
\fB*@\fR\fIdomain\fR to \fB*\fR
.RE
.RS +4
.TP
6.
\fB*@\fR\fIdomain\fR to \fB""\fR
.RE
.RS +4
.TP
7.
\fB*@\fR\fIdomain\fR to \fIunix-name\fR
.RE
.RS +4
.TP
8.
\fB*@*\fR to \fB*\fR
.RE
.RS +4
.TP
9.
\fB*@*\fR to \fB""\fR
.RE
.RS +4
.TP
10.
\fB*@*\fR to \fIunix-name\fR
.RE
.sp
.LP
When mapping a UNIX name to a Windows name, lookup for name-based mapping rules
is performed in the following order:
.RS +4
.TP
1.
\fIunix-name\fR to \fB""\fR
.RE
.RS +4
.TP
2.
\fIunix-name\fR to \fIwindows-name\fR\fB@\fR\fIdomain\fR
.RE
.RS +4
.TP
3.
\fB*\fR to \fB*@\fR\fIdomain\fR
.RE
.RS +4
.TP
4.
\fB*\fR to \fB""\fR
.RE
.RS +4
.TP
5.
\fB*\fR to \fIwindows-name\fR\fB@\fR\fIdomain\fR
.RE
.SS "Service Properties"
.sp
.LP
The service properties determine the behavior of the \fBidmapd\fR(1M) daemon.
These properties are stored in the SMF repository (see \fBsmf\fR(5)) under
property group \fBconfig\fR. They can be accessed and modified using
\fBsvccfg\fR(1M), which requires \fBsolaris.smf.value.idmap\fR authorization.
The service properties for the \fBidmap\fR service are:
.sp
.ne 2
.na
\fB\fBconfig/ad_unixuser_attr\fR\fR
.ad
.sp .6
.RS 4n
Specify the name of the AD attribute that contains the UNIX user name. There is
no default.
.RE

.sp
.ne 2
.na
\fB\fBconfig/ad_unixgroup_attr\fR\fR
.ad
.sp .6
.RS 4n
Specify the name of the AD attribute that contains the UNIX group name. There
is no default.
.RE

.sp
.ne 2
.na
\fB\fBconfig/nldap_winname_attr\fR\fR
.ad
.sp .6
.RS 4n
Specify the name of the Native LDAP attribute that contains the Windows
user/group name. There is no default.
.RE

.sp
.ne 2
.na
\fB\fBconfig/directory_based_mapping\fR\fR
.ad
.sp .6
.RS 4n
Controls support for identity mapping using data stored in a directory service.
.sp
\fBnone\fR disables directory-based mapping.
.sp
\fBname\fR enables name-based mapping using the properties described above.
.sp
\fBidmu\fR enables mapping using Microsoft's Identity Management for UNIX
(IDMU). This Windows component allows the administrator to specify a UNIX user
ID for each Windows user, mapping the Windows identity to the corresponding
UNIX identity. Only IDMU data from the domain the Solaris system is a member of
is used.
.RE

.sp
.LP
Changes to service properties do not affect a running \fBidmap\fR service. The
service must be refreshed (with \fBsvcadm\fR(1M)) for the changes to take
effect.
.SH OPERANDS
.sp
.LP
The \fBidmap\fR command uses the following operands:
.sp
.ne 2
.na
\fB\fIformat\fR\fR
.ad
.sp .6
.RS 4n
Specifies the format in which user name mappings are described for the
\fBexport\fR and \fBimport\fR subcommands. The Netapp \fBusermap.cfg\fR and
Samba \fBsmbusers\fR external formats are supported. These external formats are
\fBonly\fR for users, not groups.
.RS +4
.TP
.ie t \(bu
.el o
The \fBusermap.cfg\fR rule-mapping format is as follows:
.sp
.in +2
.nf
\fIwindows-username\fR [\fIdirection\fR] \fIunix-username\fR
.fi
.in -2
.sp

\fIwindows-username\fR is a Windows user name in either the
\fIdomain\fR\e\fIusername\fR or \fIusername\fR\fB@\fR\fIdomain\fR format.
.sp
\fIunix-username\fR is a UNIX user name.
.sp
.LP
\fIdirection\fR is one of the following:
.RS +4
.TP
.ie t \(bu
.el o
\fB==\fR means a bidirectional mapping, which is the default.
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fB=>\fR or \fB<=\fR means a unidirectional mapping.
.RE
The IP qualifier is not supported.
.RE
.RS +4
.TP
.ie t \(bu
.el o
The \fBsmbusers\fR rule-mapping format is as follows:
.sp
.in +2
.nf
\fIunixname\fR = \fIwinname1\fR \fIwinname2\fR ...
.fi
.in -2
.sp

If \fIwinname\fR includes whitespace, escape the whitespace by enclosing the
value in double quotes. For example, the following file shows how to specify
whitespace in a valid format for the \fBidmap\fR command:
.sp
.in +2
.nf
$ \fBcat myusermap\fR
terry="Terry Maddox"
pat="Pat Flynn"
cal=cbrown
.fi
.in -2
.sp

The mappings are imported as unidirectional mappings from Windows names to UNIX
names.
.sp
The format is based on the "username map" entry of the \fBsmb.conf\fR man page,
which is available on the \fBsamba.org\fR web site. The use of an asterisk
(\fB*\fR) for \fIwindows-name\fR is supported. However, the \fB@group\fR
directive and the chaining of mappings are not supported.
.sp
By default, if no mapping entries are in the \fBsmbusers\fR file, Samba maps a
\fIwindows-name\fR to the equivalent \fIunix-name\fR, if any. If you want to
set up the same mapping as Samba does, use the following \fBidmap\fR command:
.sp
.in +2
.nf
idmap add -d "winuser:*@*" "unixuser:*"
.fi
.in -2
.sp

.RE
.RE

.sp
.ne 2
.na
\fB\fIidentity\fR\fR
.ad
.sp .6
.RS 4n
Specifies a user name, user ID, group name, or group ID. \fIidentity\fR is
specified as \fItype\fR\fB:\fR\fIvalue\fR. \fItype\fR is one of the following:
.sp
.ne 2
.na
\fB\fBusid\fR\fR
.ad
.RS 13n
Windows user SID in text format
.RE

.sp
.ne 2
.na
\fB\fBgsid\fR\fR
.ad
.RS 13n
Windows group SID in text format
.RE

.sp
.ne 2
.na
\fB\fBsid\fR\fR
.ad
.RS 13n
Windows group SID in text format that can belong either to a user or to a group
.RE

.sp
.ne 2
.na
\fB\fBuid\fR\fR
.ad
.RS 13n
Numeric POSIX UID
.RE

.sp
.ne 2
.na
\fB\fBgid\fR\fR
.ad
.RS 13n
Numeric POSIX GID
.RE

.sp
.ne 2
.na
\fB\fBunixuser\fR\fR
.ad
.RS 13n
UNIX user name
.RE

.sp
.ne 2
.na
\fB\fBunixgroup\fR\fR
.ad
.RS 13n
UNIX group name
.RE

.sp
.ne 2
.na
\fB\fBwinuser\fR\fR
.ad
.RS 13n
Windows user name
.RE

.sp
.ne 2
.na
\fB\fBwingroup\fR\fR
.ad
.RS 13n
Windows group name
.RE

.sp
.ne 2
.na
\fB\fBwinname\fR\fR
.ad
.RS 13n
Windows user or group name
.RE

\fIvalue\fR is a number or string that is appropriate to the specified
\fItype\fR. For instance, \fBunixgroup:staff\fR specifies the UNIX group name,
\fBstaff\fR. The identity \fBgid:10\fR represents GID 10, which corresponds to
the UNIX group \fBstaff\fR.
.RE

.sp
.ne 2
.na
\fB\fIname\fR\fR
.ad
.sp .6
.RS 4n
Specifies a UNIX name (\fBunixuser\fR, \fBunixgroup\fR) or a Windows name
(\fBwinuser\fR, \fBwingroup\fR) that can be used for name-based mapping rules.
.sp
.LP
A Windows security entity name can be specified in one of these ways:
.RS +4
.TP
.ie t \(bu
.el o
\fIdomain\fR\e\fIname\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fIname\fR\fB@\fR\fIdomain\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fIname\fR, which uses the default mapping domain
.RE
If \fIname\fR is the empty string (\fB""\fR), mapping is inhibited. Note that a
name of \fB""\fR should not be used to preclude logins by unmapped Windows
users.
.sp
If \fIname\fR uses the wildcard (\fB*\fR), it matches all names that are not
matched by other mappings. Similarly, if \fIname\fR is the wildcard Windows
name (\fB*@*\fR), it matches all names in all domains that are not matched by
other mappings.
.sp
If \fIname\fR uses the wildcard on both sides of the mapping rule, the name is
the same for both Windows and Solaris users. For example, if the rule is
\fB"*@domain" == "*"\fR, the \fBjp@domain\fR Windows user name matches this
rule and maps to the \fBjp\fR Solaris user name.
.sp
Specifying the type of \fIname\fR is optional if the type can be deduced from
other arguments or types specified on the command line.
.RE

.sp
.ne 2
.na
\fB\fItarget-type\fR\fR
.ad
.sp .6
.RS 4n
Used with the \fBshow\fR and \fBunset-namemap\fR subcommands. For \fBshow\fR,
specifies the mapping type that should be shown. For example, if
\fItarget-type\fR is \fBsid\fR, \fBidmap show\fR returns the SID mapped to the
identity specified on the command line. For \fBunset-namemap\fR, identifies an
attribute within the object specified by the \fIname\fR operand.
.RE

.SH OPTIONS
.sp
.LP
The \fBidmap\fR command supports one option and a set of subcommands. The
subcommands also have options.
.SS "Command-Line Option"
.sp
.ne 2
.na
\fB\fB-f\fR \fIcommand-file\fR\fR
.ad
.sp .6
.RS 4n
Reads and executes \fBidmap\fR subcommands from \fIcommand-file\fR. The
\fBidmap\fR \fB-f\fR \fB-\fR command reads from standard input. This option is
not used by any subcommands.
.RE

.SS "Subcommands"
.sp
.LP
The following subcommands are supported:
.sp
.ne 2
.na
\fB\fBadd\fR [\fB-d\fR] \fIname1\fR \fIname2\fR\fR
.ad
.sp .6
.RS 4n
Adds a name-based mapping rule. By default, the name mapping is bidirectional.
If the \fB-d\fR option is used, a unidirectional mapping is created from
\fIname1\fR to \fIname2\fR.
.sp
Either \fIname1\fR or \fIname2\fR must be a Windows name, and the other must be
a UNIX name. For the Windows name, the \fBwinname\fR identity type must not be
used. Instead, specify one of the \fBwinuser\fR or \fBwingroup\fR types. See
"Operands" for information about the \fIname\fR operand.
.sp
Note that two unidirectional mappings between the same two names in two
opposite directions are equivalent to one bidirectional mapping.
.sp
This subcommand requires the \fBsolaris.admin.idmap.rules\fR authorization.
.RE

.sp
.ne 2
.na
\fB\fBdump\fR [\fB-n\fR] [\fB-v\fR]\fR
.ad
.sp .6
.RS 4n
Dumps all the mappings cached since the last system boot. The \fB-n\fR option
shows the names, as well. By default, only \fBsid\fRs, \fBuid\fRs, and
\fBgid\fRs are shown. The \fB-v\fR option shows how the mappings were
generated.
.RE

.sp
.ne 2
.na
\fB\fBexport\fR [\fB-f\fR \fIfile\fR] \fIformat\fR\fR
.ad
.sp .6
.RS 4n
Exports name-based mapping rules to standard output in the specified
\fIformat\fR. The \fB-f\fR \fIfile\fR option writes the rules to the specified
output file.
.RE

.sp
.ne 2
.na
\fB\fBget-namemap\fR \fIname\fR\fR
.ad
.sp .6
.RS 4n
Get the directory-based name mapping information from the AD or native LDAP
user or group object represented by the specified name.
.RE

.sp
.ne 2
.na
\fB\fBhelp\fR\fR
.ad
.sp .6
.RS 4n
Displays the usage message.
.RE

.sp
.ne 2
.na
\fB\fBimport\fR [\fB-F\fR] [\fB-f\fR \fIfile\fR] \fIformat\fR\fR
.ad
.sp .6
.RS 4n
Imports name-based mapping rules from standard input by using the specified
\fIformat\fR. The \fB-f\fR \fIfile\fR option reads the rules from the specified
file. The \fB-F\fR option flushes existing name-based mapping rules before
adding new ones.
.sp
Regardless of the external format used, the imported rules are processed by
using the semantics and order described in the section "Rule Lookup Order,"
above.
.sp
This subcommand requires the \fBsolaris.admin.idmap.rules\fR authorization.
.RE

.sp
.ne 2
.na
\fB\fBlist\fR\fR
.ad
.sp .6
.RS 4n
Lists all name-based mapping rules. Each rule appears in its \fBidmap add\fR
form.
.RE

.sp
.ne 2
.na
\fB\fBremove\fR [\fB-t\fR|\fB-f\fR] \fIname\fR\fR
.ad
.sp .6
.RS 4n
Removes any name-based mapping rule that involves the specified name.
\fIname\fR can be either a UNIX or Windows user name or group name.
.sp
The \fB-f\fR option removes rules that use \fIname\fR as the source. The
\fB-t\fR option removes rules that use \fIname\fR as the destination. These
options are mutually exclusive.
.sp
This subcommand requires the \fBsolaris.admin.idmap.rules\fR authorization.
.RE

.sp
.ne 2
.na
\fB\fBremove\fR \fB-a\fR\fR
.ad
.sp .6
.RS 4n
Removes all name-based mapping rules.
.sp
This subcommand requires the \fBsolaris.admin.idmap.rules\fR authorization.
.RE

.sp
.ne 2
.na
\fB\fBremove\fR [\fB-d\fR] \fIname1\fR \fIname2\fR\fR
.ad
.sp .6
.RS 4n
Removes name-based mapping rules between \fIname1\fR and \fIname2\fR. If the
\fB-d\fR option is specified, rules from \fIname1\fR to \fIname2\fR are
removed.
.sp
Either \fIname1\fR or \fIname2\fR must be a Windows name, and the other must be
a UNIX name.
.sp
This subcommand requires the \fBsolaris.admin.idmap.rules\fR authorization.
.RE

.sp
.ne 2
.na
\fB\fBset-namemap\fR [\fB-a\fR \fIauthenticationMethod\fR] [\fB-D\fR
\fIbindDN\fR] [\fB-j\fR \fIpasswdfile\fR] \fIname1\fR \fIname2\fR\fR
.ad
.sp .6
.RS 4n
Sets name mapping information in the AD or native LDAP user or group object.
Either \fIname1\fR or \fIname2\fR must be a Windows name, and the other must be
a UNIX name.
.sp
If \fIname1\fR is a Windows name, then the UNIX name \fIname2\fR is added to
the AD object represented by \fIname1\fR. Similarly, if \fIname1\fR is a UNIX
name then the Windows name \fIname2\fR is added to the native LDAP entry
represented by \fIname1\fR.
.sp
The following options are supported:
.sp
.ne 2
.na
\fB\fB-a\fR \fIauthenticationMethod\fR\fR
.ad
.sp .6
.RS 4n
Specify authentication method when modifying native LDAP entry. See
\fBldapaddent\fR(1M) for details. Default value is \fBsasl/GSSAPI\fR.
.RE

.sp
.ne 2
.na
\fB\fB-D\fR \fIbindDN\fR\fR
.ad
.sp .6
.RS 4n
Uses the distinguished name \fIbindDN\fR to bind to the directory.
.RE

.sp
.ne 2
.na
\fB\fB-j\fR \fIpasswdfile\fR\fR
.ad
.sp .6
.RS 4n
Specify a file containing the password for authentication to the directory.
.RE

.RE

.sp
.ne 2
.na
\fB\fBshow\fR [\fB-c\fR] [\fB-v\fR] \fIname\fR [\fItarget-type\fR]\fR
.ad
.sp .6
.RS 4n
Shows the identity of type, \fItarget-type\fR, that the specified \fIname\fR
maps to. If the optional \fItarget-type\fR is omitted, the non-diagonal mapping
is shown.
.sp
By default, this subcommand shows only mappings that have been established
already. The \fB-c\fR option forces the evaluation of name-based mapping
configurations or the dynamic allocation of IDs.
.sp
The \fB-v\fR option shows how the mapping was generated and also whether the
mapping was just generated or was retrieved from the cache.
.RE

.sp
.ne 2
.na
\fB\fBunset-namemap\fR [\fB-a\fR \fIauthenticationMethod\fR] [\fB-D\fR
\fIbindDN\fR] [\fB-j\fR \fIpasswdfile\fR] \fIname\fR [\fItarget-type\fR]\fR
.ad
.sp .6
.RS 4n
Unsets directory-based name mapping information from the AD or native LDAP user
or group object represented by the specified name and optional target type.
.sp
See the \fBset-namemap\fR subcommand for options.
.RE

.SH EXAMPLES
.LP
\fBExample 1 \fRUsing a Wildcard on Both Sides of a Name-Based Mapping Rule
.sp
.LP
The following command maps all Windows user names in the \fBxyz.com\fR domain
to the UNIX users with the same names provided that one exists and is not
otherwise mapped. If such a rule is matched but the UNIX user name does not
exist, an ephemeral ID mapping is used.

.sp
.in +2
.nf
# \fBidmap add "winuser:*@xyz.com" "unixuser:*"\fR
.fi
.in -2
.sp

.LP
\fBExample 2 \fRUsing a Wildcard on One Side of a Name-Based Mapping Rule
.sp
.LP
The following command maps all unmapped Windows users in the \fBxyz.com\fR
domain to the \fBguest\fR UNIX user. The \fB-d\fR option specifies a
unidirectional mapping from \fB*@xyz.com\fR users to the \fBguest\fR user.

.sp
.in +2
.nf
# \fBidmap add -d "winuser:*@xyz.com" unixuser:guest\fR
.fi
.in -2
.sp

.LP
\fBExample 3 \fRAdding a Bidirectional Name-Based Mapping Rule
.sp
.LP
The following command maps Windows user, \fBfoobar@example.com\fR, to UNIX
user, \fBfoo\fR, and conversely:

.sp
.in +2
.nf
# \fBidmap add winuser:foobar@example.com unixuser:foo\fR
.fi
.in -2
.sp

.sp
.LP
This command shows how to remove the mapping added by the previous command:

.sp
.in +2
.nf
# \fBidmap remove winuser:foobar@example.com unixuser:foo\fR
.fi
.in -2
.sp

.LP
\fBExample 4 \fRShowing a UID-to-SID Mapping
.RS +4
.TP
.ie t \(bu
.el o
The following command shows the SID that the specified UID, \fBuid:50000\fR,
maps to:
.sp
.in +2
.nf
# \fBidmap show uid:50000 sid\fR
uid:50000 -> usid:S-1-5-21-3223191800-2000
.fi
.in -2
.sp

.RE
.RS +4
.TP
.ie t \(bu
.el o
The following command shows the UNIX user name that the specified Windows user
name, \fBjoe@example.com\fR, maps to:
.sp
.in +2
.nf
# \fBidmap show joe@example.com unixuser\fR
winuser:joe@example.com -> unixuser:joes
.fi
.in -2
.sp

.RE
.LP
\fBExample 5 \fRListing the Cached SID-to-UID Mappings
.sp
.LP
The following command shows all of the SID-to-UID mappings that are in the
cache:

.sp
.in +2
.nf
# \fBidmap dump | grep "uid:"\fR
usid:S-1-5-21-3223191800-2000    ==     uid:50000
usid:S-1-5-21-3223191800-2001    ==     uid:50001
usid:S-1-5-21-3223191800-2006    ==     uid:50010
usid:S-1-5-21-3223191900-3000    ==     uid:2147491840
usid:S-1-5-21-3223191700-4000    =>     uid:60001
.fi
.in -2
.sp

.LP
\fBExample 6 \fRBatching \fBidmap\fR Requests
.sp
.LP
The following commands show how to batch \fBidmap\fR requests. This particular
command sequence does the following:

.RS +4
.TP
.ie t \(bu
.el o
Removes any previous rules for \fBfoobar@example.com\fR.
.RE
.RS +4
.TP
.ie t \(bu
.el o
Maps Windows user \fBfoobar@example.com\fR to UNIX user \fBbar\fR and
vice-versa.
.RE
.RS +4
.TP
.ie t \(bu
.el o
Maps Windows group \fBmembers\fR to UNIX group \fBstaff\fR and vice-versa.
.RE
.sp
.in +2
.nf
# \fBidmap <<EOF\fR
       \fBremove winuser:foobar@example.com\fR
       \fBadd winuser:foobar@example.com unixuser:bar\fR
       \fBadd wingroup:members unixgroup:staff\fR
\fBEOF\fR
.fi
.in -2
.sp

.LP
\fBExample 7 \fRListing Name-Based Mapping Rules
.sp
.LP
The following command shows how to list the name-based mapping rules:

.sp
.in +2
.nf
# \fBidmap list\fR
add winuser:foobar@example.com unixuser:bar
add wingroup:members unixgroup:staff
.fi
.in -2
.sp

.LP
\fBExample 8 \fRImporting Name-Based Mapping Rules From the \fBusermap.cfg\fR
File
.sp
.LP
The \fBusermap.cfg\fR file can be used to configure name-based mapping rules.
The following \fBusermap.cfg\fR file shows mapping rules that map Windows user
\fBfoo@example.com\fR to UNIX user \fBfoo\fR, and that map
\fBfoobar@example.com\fR to the UNIX user \fBfoo\fR.

.sp
.in +2
.nf
# \fBcat usermap.cfg\fR
foo@example.com == foo
foobar@example.com => foo
.fi
.in -2
.sp

.sp
.LP
The following \fBidmap\fR command imports \fBusermap.cfg\fR information to the
\fBidmapd\fR database:

.sp
.in +2
.nf
# \fBcat usermap.cfg | idmap import usermap.cfg\fR
.fi
.in -2
.sp

.sp
.LP
This command does the same as the previous command:

.sp
.in +2
.nf
# \fBidmap import -f usermap.cfg usermap.cfg\fR
.fi
.in -2
.sp

.sp
.LP
The following commands are equivalent to the previous \fBidmap import\fR
commands:

.sp
.in +2
.nf
# \fBidmap <<EOF\fR
       \fBadd winuser:foo@example.com unixuser:foo\fR
       \fBadd -d winuser:foobar@example.com unixuser:foo\fR
\fBEOF\fR
.fi
.in -2
.sp

.LP
\fBExample 9 \fRUsing Name-Based and Ephemeral ID Mapping With Identity
Function Mapping and Exceptions
.sp
.LP
The following commands map all users in the \fBexample.com\fR Windows domain to
UNIX user accounts of the same name. The command also specifies mappings for
the following Windows users: \fBjoe@example.com\fR, \fBjane.doe@example.com\fR,
\fBadministrator@example.com\fR. The \fBadministrator\fR from all domains is
mapped to \fBnobody\fR. Any Windows users without corresponding UNIX accounts
are mapped dynamically to available ephemeral UIDs.

.sp
.in +2
.nf
# \fBidmap import usermap.cfg <<EOF\fR
       \fBjoe@example.com == joes\fR
       \fBjane.doe@example.com == janed\fR
       \fBadministrator@* => nobody\fR
       \fB*@example.com == *\fR
       \fB*@example.com => nobody\fR
\fBEOF\fR
.fi
.in -2
.sp

.LP
\fBExample 10 \fRAdding Directory-based Name Mapping to AD User Object
.sp
.LP
The following command maps Windows user \fBjoe@example.com\fR to UNIX user
\fBjoe\fR by adding the UNIX name to AD object for \fBjoe@example.com\fR.

.sp
.in +2
.nf
# \fBidmap set-namemap winuser:joe@example.com joes\fR
.fi
.in -2
.sp

.LP
\fBExample 11 \fRAdding Directory-based Name Mapping to Native LDAP User Object
.sp
.LP
The following command maps UNIX user \fBfoo\fR to Windows user
\fBfoobar@example.com\fR by adding the Windows name to native LDAP object for
\fBfoo\fR.

.sp
.in +2
.nf
# \fBidmap set-namemap unixuser:foo foobar@example.com\fR
.fi
.in -2
.sp

.LP
\fBExample 12 \fRRemoving Directory-based Name Mapping from AD User Object
.sp
.LP
The following command removes the UNIX username \fBunixuser\fR from the AD
object representing \fBjoe@example.com\fR.

.sp
.in +2
.nf
# \fBidmap unset-namemap winuser:joe@example.com unixuser\fR
.fi
.in -2
.sp

.SH EXIT STATUS
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 6n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB>0\fR\fR
.ad
.RS 6n
An error occurred. A diagnostic message is written to standard error.
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Uncommitted
.TE

.SH SEE ALSO
.sp
.LP
\fBsvcs\fR(1), \fBidmapd\fR(1M), \fBldapaddent\fR(1M), \fBsvcadm\fR(1M),
\fBsvccfg\fR(1M), \fBattributes\fR(5), \fBsmf\fR(5)
.SH NOTES
.sp
.LP
The \fBidmapd\fR service is managed by the service management facility,
\fBsmf\fR(5). The service identifier for the \fBidmapd\fR service is
\fBsvc:/system/idmap\fR.
.sp
.LP
Use the \fBsvcadm\fR command to perform administrative actions on this service,
such as enabling, disabling, or restarting the service. These actions require
the \fBsolaris.smf.manage.idmap\fR authorization. Use the \fBsvcs\fR command to
query the service's status.
.sp
.LP
Windows user names are case-insensitive, while UNIX user names are
case-sensitive. The case of Windows names as they appear in \fBidmap\fR
name-rules and \fBidmap show\fR command lines is irrelevant.
.sp
.LP
Because common practice in UNIX environments is to use all-lowercase user
names, wildcard name-rules map Windows names to UNIX user/group names as
follows: first, the canonical Windows name (that is, in the case as it appears
in the directory) is used as a UNIX user or group name. If there is no such
UNIX entity, then the Windows name's case is folded to lowercase and the result
is used as the UNIX user or group name.
.sp
.LP
As a result of this differing treatment of case, user names that appear to be
alike might not be recognized as matches. You must create rules to handle such
pairings of strings that differ only in case. For example, to map the Windows
user \fBsam@example\fR to the Solaris user \fBSam\fR, you must create the
following rules:
.sp
.in +2
.nf
# \fBidmap add "winuser:*@example" "unixuser:*"\fR
# \fBidmap add winuser:sam@example unixuser:Sam\fR
.fi
.in -2
.sp

.sp
.LP
For guidance on modifying an Active Directory schema, consult the Microsoft
document, \fIStep-by-Step Guide to Using Active Directory Schema and Display
Specifiers\fR, which you can find at their \fBtechnet\fR web site,
http://technet.microsoft.com/\&.