Note: This code
is in
SAS-installation-directory\SASFoundation\9.3\core\sample\importpw.sas
(Windows) or
SAS-installation-directory/SASFoundation/9.3/samples/base/importpw.sas
(UNIX). This topic highlights key points about the code.
This program expects
user information in
/etc/passwd
files
in this form:
user name : password : uid (numeric) : primary group id : <continued>
gcos-field: home-directory : login-shell
The
gcos-field
item consists of additional comma-delimited
fields in this form:
Person Name, Office, phone extension, misc, employeeid
For example:
user name : password : uid (numeric) : primary group id : <continued>
Person Name, Office, phone extension, misc, employeeid:<continued>
home-directory : login-shell
Here are details about
this code:
-
The colons delimit standard fields;
the commas delimit items within the
gcos-field
(you can use any delimiter other than a colon).
-
If your
/etc/passwd
file has a different format, modify the sample program to either
exclude information from the extraction or to extract it from the
appropriate fields.
-
If the
employeeid
field for an
/etc/passwd
entry is
empty, that entry is dropped from the import.
-
The values in the
Person
Name
field should be unique. The program includes a
DUPLICATEPERSONS macro variable that, when set to RECODE, changes
a duplicate value in the
Person Name
field
to the user ID value of the PW file entry. However, if the DUPLICATEPERSONS
macro variable is set to any other value, users with duplicate names
in the
Person Name
field are deleted.
The program expects
group information in a
/etc/group
file.
The standard format is as follows:
groupname : password : gid (numeric) : comma-delimited list of users
Here are details about this file:
-
Users are identified by user name
(rather than by a numeric user ID).
-
A group cannot be a member of another
group.
-
To exclude a user or group, enter
an asterisk (*) in the password field. The import program drops entries
that contain an asterisk in the password field.
The following table
highlights selected variables:
Selected Variables in a UNIX File Import
|
|
|
|
Provides an external
identity value for each metadata user and group that this program
creates.
|
Use a field that contains
a unique and unchanging value for each entry in an /etc/passwd file and an /etc/group file. In the sample code, the uid field of the gcos-field is used.
If this field is empty for any records, those records are excluded
from the import.
|
|
Enables all metadata
logins that this program creates to be associated with an authentication
domain.
|
Specify a SAS authentication
domain name. The supplied value is typically DefaultAuth .
|
|
Enables construction
of an e-mail address for each user.
|
Specify the UNIX domain
for the extracted identities. The supplied value is appended to extracted
user IDs to yield e-mail addresses in the form userid@supplied-value. If your e-mail addresses
follow a different convention, modify this part of the code.
|
|
Provides a label for
all metadata items that this program creates. The label indicates
which objects were created by this program.
|
Specify a descriptive
label that will be applied to all imported objects to indicate where
they came from. The default value is Passwd File Import . Do not quote this value. If you select the External
Identities button on an imported identity's General tab (in SAS Management Console), you will see
this label in the Context column of the External Identities dialog box.
|