Previous Page | Next Page

User Import Macros

About the Sample Code for UNIX /etc/passwd Import

Note:   This code is in SAS-installation-directory\SASFoundation\9.2\core\sample\importpw.sas (Windows) or SAS-installation-directory/SASFoundation/9.2/samples/base/importpw.sas (UNIX). This topic highlights key points about the code.  [cautionend]

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 program expects group information in an /etc/group file. The standard format is as follows:

groupname : password : gid (numeric) : comma-delimited list of users

Here are details about this file:

The following table highlights selected variables:

Selected Variables in a UNIX File Import
Variable Name Purpose Notes
UID 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 and an /etc/group files. 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.
MetadataAuthDomain 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.
UNIXEMAILDOMAIN 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.
PWExtIDTAG 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.

Previous Page | Next Page | Top of Page