![]() |
![]() |
![]() |
![]() |
![]() |
This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Change the login password or create new user names (UNIX)
passwd [name]
Neutrino
You can use the passwd utility to change your login password, and if you're logged in as the superuser (root), you can create a new user account.
![]() |
This utility needs to have the setuid ("set user ID") bit set in its permissions. If you use mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use the perms attribute to specify its permissions explicitly, and the uid and gid attributes to set the ownership correctly. |
If you're changing your password, passwd prompts for the old password and then for the new password. The new password must be entered twice, to avoid typing mistakes. Only the owner or the superuser may change a password.
To create a new user account, type:
passwd new_user_name
![]() |
Make sure that the user name is no longer than 14 characters; otherwise, that user won't be able to log in. |
When creating a new user account, passwd prompts for information, such as the user's group list, home directory, and shell. The /etc/default/passwd file (see "Files," below) specifies the default values for these prompts. You can edit this file to modify passwd's behavior to suit local requirements.
The /etc/passwd file contains the following fields, separated by colons:
username:has_passwd:userid:groupid:misc:home_directory:initial_command
If the has_passwd field contains an x character, a password has been defined for this user. If no character is present, no password has been defined. Use of any other character is reserved and may cause side-effects for the user.
The groupid field contains a group number. Users may log in under the groupid listed in their /etc/passwd file entry without being listed as a member of that group in the /etc/group file.
The misc field stores supplemental information, with commas separating subfields. Usually, the first subfield contains the user's "real life" name. Some utilities use this information.
The initial_command field contains the initial command to run after the user has successfully logged in. This command and any arguments it takes must be separated by tab or space characters. As the command is spawned directly (not run by a shell), no shell expansions is performed. There is no mechanism for specifying command-line arguments that contain space or tab characters themselves. (Quoting isn't supported.)
If no initial_command is specified, /bin/sh is used.
Entries in this file appear in the following format:
groupname:x:groupid:user[,user]...
The x represents the group password; Neutrino doesn't support group passwords.
username:has_passwd:userid:groupid:misc:home_directory:initial_command
The passwd utility creates the /etc/.pwlock file during updates to the password database. If for some reason the system crashes at an inopportune moment and leaves this file present, passwd will refuse to work until the file is removed by the system administrator. If the password files are somehow left in an inconsistent state as a result of the crash, the system administrator should also copy /etc/oshadow to /etc/shadow and copy /etc/opasswd to /etc/passwd.
crypt(), qnx_crypt() in the Library Reference
Managing User Accounts in the Neutrino User's Guide
![]() |
![]() |
![]() |
![]() |