Users and groups

The users.xml and groups.xml files define the users and groups that are used to assign permissions to files and directories defined in the filesets.

When you want to add a new user or group, or modify an existing user or group, you must update the users.xml or groups.xml file located in the $QNX_DEPLOYMENT_WORKSPACE/infra/filesets/config directory. These files use XML to define users and groups. The users and groups they define are just like the POSIX users and groups in the /etc/passwd file.

Note:

The users and groups under $QNX_DEPLOYMENT_WORKSPACE/infra/filesets/config aren't synchronized with the users and groups under /etc/passwd.

The users and groups in the users.xml and groups.xml files are used for the filesets, and by mksysimage to set the user and group IDs (uid and gid) for files that will go into a target image. Updates to the users.xml and groups.xml files aren't reflected in /etc/passwd, which is used by the system. Inversely, updates to /etc/passwd don't change the contents of the users.xml and groups.xml files.

Adding a group

Some gid values are reserved. See the comments in groups.xml for the number ranges that are reserved.

To add a new group:

  1. Choose an unused number for the group ID.
  2. Add a new <group> element to the groups.xml file. For example, the following creates the group “hamlet”, with ID “123”, and members “rosencrantz” and “guildenstern”:

    <group name="hamlet" gid="123" members="rosencrantz,guildenstern"/>
  3. If you haven't already done so, in the users.xml file, define the users you have listed as members of your new group.

Adding a user

Every user must belong to a group. A user's gid can't be null.

To add a new user:

  1. Identify the groups to which the user will belong and note their group ID numbers.
  2. Add a new <user> element in the users.xml file. For example, the following creates the user “rosencrantz”, with ID “1599”:

    <user name="rosencrantz" uid="900" gid="511"/ home="/denmark"
     shell="/bin" fullname="Rasmus Rosencrantz"/>
  3. If you haven't already done son, in the groups.xml file, add the user's name to the definitions of all the groups to which the new user must belong.