set_local_user_profile_field

Use the set_local_user_profile_field command to set the value of the specified profile field for the currently selected local UNIX or Linux user that has a profile defined in the current zone. Before executing this command, you must create a new local user by executing the new_local_user_profile command, or select an existing local user by executing the select_local_user_profile command.

You can save a user object before the user profile is complete. However, the user profile is not added to /etc/passwd on each UNIX and Linux computer in the zone until the user profile is complete, the profileflag field is set to 1 (enabled) or 2 (disabled), and the user is assigned a visible role such as local listed. See new_local_user_profile for details about which attributes a user profile must have to be considered complete.

Zone type

Hierarchical only.

Syntax

set_local_user_profile_field field_name value

Abbreviation

slupf

Options

This command takes no options.

Arguments

This command takes the following arguments:

Argument Type Description

field_name

value

String

Required. Specifies the local user profile field to set. Fields and possible values are:

  • Any field: Clear any field by entering a hyphen character (-).
  • uid: The user’s numeric identifier.
  • gid: The user’s primary group numeric identifier.
  • shell: The local user’s default shell on the local computer. Possible values are: /bin/bash, /bin/csh, /bin/ksh, /bin/sh, /bin/tcsh, %{shell}.
  • home: The local user’s default home directory on the local computer.
  • gecos: General information about the local user account.
  • profileflag: The value of the user’s profile flag as set in the user object in the zone. For the user to be managed by the agent, the profile flag must be set to 1 , 2, or 3.

    If set to 1, the user profile is enabled. If the user profile is complete, the profile flag is set to 1, and the user is assigned a visible role, the profile will be installed or updated in /etc/passwd at the next local account refresh interval.

    If set to 2, the user profile is disabled. If the user profile is complete, the profile flag is set to 2, and the user is assigned a visible role, the profile will be installed or updated in /etc/passwd at the next local account refresh interval. However, the password field in /etc/passwd will be set to !!, and the user will not be able to log into the local computer. This state results in what is typically called a “locked account.”

    If set to 3, the user profile is removed from /etc/passwd at the next local account refresh interval.

Return value

This command returns nothing if it runs successfully.

Examples

The following example sets the UID of the currently selected user to 10001.

set_local_user_profile_field uid 10001

The following example sets the primary group ID for the currently selected user to 20001.

set_local_user_profile_field gid 20001

The following example sets the default shell for the currently selected user to /bin/csh:

set_local_user_profile_field shell /bin/csh

The following example sets the home directory for the currently selected user to /home.

set_local_user_profile_field home /home

The following example sets the profile flag of the currently selected user to 1 (enabled), so that if the user profile is complete and the user is assigned a visible role, the profile will be installed or updated in /etc/passwd at the next local account refresh interval.

set_local_user_profile_field profileflag 1

Related commands

The following related ADEdit commands let you view and administer local UNIX and Linux users and groups that have profiles defined in the current zone:

  • delete_local_group_profile deletes a local UNIX or Linux group that has a profile defined in the current zone.
  • delete_local_user_profile deletes a local UNIX or Linux user that has a profile defined in the current zone.
  • get_local_group_profile_field displays the value of a profile field for the currently selected local UNIX or Linux group that has a profile defined in the current zone.
  • get_local_groups_profile displays a TCL list of profiles for local groups that are defined in the current zone.
  • get_local_user_profile_field displays the value of a profile field for the currently selected local UNIX or Linux user that has a profile defined in the current zone.
  • get_local_users_profile displays a TCL list of profiles for local users that are defined in the current zone.
  • list_local_groups_profile displays a list of local UNIX and Linux groups that have a profile defined in the current zone.
  • list_local_users_profile displays a list of local UNIX and Linux users that have a profile defined in the current zone.
  • new_local_group_profile creates an object for a local UNIX or Linux group in the currently selected zone.
  • new_local_user_profile creates an object for a local UNIX or Linux user in the currently selected zone.
  • save_local_group_profile saves the currently selected local UNIX or Linux group object after you create the group object or edit profile field values in the group object.
  • save_local_user_profile saves the currently selected local UNIX or Linux user object after you create the user object or edit profile field values in the user object.
  • select_local_group_profile selects a local UNIX or Linux group object for viewing or editing.
  • select_local_user_profile selects a local UNIX or Linux user object for viewing or editing.
  • set_local_group_profile_field sets the value of a field for the currently selected local UNIX or Linux group that has a profile defined in the current zone.