Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Changing usernames in QNX4
Ref. No. QNX.000001003
Category(ies) Configuration
Issue Is there an easy way to change the username for a person (ie, marriage)?

One thought we had was to create a new user (with the new name), assign a new password, and then do a recursive chown on his/her home directory.  [users only store files in their home directories]




Solution One way to do it is to edit the /etc/passwd and /etc/shadow files for the person.

For example, to change jdoe to jsmith:
  -in the /etc/passwd file, change:

jdoe:x:307:127:Jane Doe://107/home/jdoe:/bin/sh

to

jsmith:x:307:127:Jane Smith://107/home/jsmith:/bin/sh

  -in the /etc/shadow file, change:

jdoe:DV40000004H01:905867050:0:0

to

jsmith:DV40000004H01:905867050:0:0


Also, the /home/jdoe directory must be moved to /home/jsmith.  To do this, simply move the whole directory structure:

mv /home/jdoe /home/jsmith

NOTE: this will keep the passwd intact as well as keep the proper user id and group for the person.  Be sure to update the opasswd and oshadow files, as these are the backups.