Your Ad Here

IBM AIX/UNIX system storage administration ksh/perl scripting

Showing posts with label users. Show all posts
Showing posts with label users. Show all posts

Wednesday, April 22, 2009

Why nobody user has -2 as uid on AIX

nobody:!:-2:-2:System Id :/:/bin/false

In the early days of unix, when they started creating common users, like root and admin and sys, the defaulted their ids as certain number so they would be common over all unix systems. They all had to create other accounts like nobody and created the id as -2, meaning that it is not a real id. (If you look at the /etc/security/passwd you will see they don't actually have a password.)

They had created this -2 in a 32 bit world. -2 is actually the twos compliment of 4294967294 in a 32 bit world. They are actually the same number. However, some programs thought that ids would only be positive and thus would reject the -2. Later versions of UNIX would allow both -2 and 4294967294 to mean the same thing. Some programs will only accept 4294967294. Which is why they have recently started to default the number to 4294967294, which by the way, is also double the maximum
number you are allow to put into that field.

In short, -2 and 4294967294 are the same number and can be swapped back and forth at will. Why they are different on different machines is propably due to the different levels of AIX that they are and when those files were made. It is also possible that some programs will change those numbers themselves. For instance, mkuser will allow you to add a user to the nobody group and even if the nobody group is 4294967294, it will change it to -2.

Tuesday, March 03, 2009

Migrating Users from One AIX System to Another AIX System

Migrating Users from One AIX System to Another AIX System

Technote (FAQ)

Question
Migrating Users from One AIX System to Another AIX System


Answer



This document discusses migrating users from one AIX system to another. This
does not include transferring the user's personal data or home directories.

The information in this document applies to AIX 5.2 and above.

Since the files involved in the following procedure are flat ASCII files
and their format has not changed from V4 to V5, the users can be migrated
between systems running the same or different versions of AIX
(for example, from V4 to V5).


Files that can be copied over


/etc/group
/etc/passwd
/etc/security/group
/etc/security/limits
/etc/security/passwd
/etc/security/.ids
/etc/security/environ
/etc/security/.profile
NOTE: Edit the passwd file so the root entry is as follows:


root:!:0:0::/:/usr/bin/ksh


When you copy the /etc/passwd and /etc/group files, make sure
they
contain
at least a minimum set of essential user and group definitions.


Listed specifically as users are the following:

  • root

  • daemon
  • bin
  • sys
  • adm
  • uucp
  • guest
  • nobody
  • lpd


Listed specifically as groups are the following:

  • system
  • staff
  • bin
  • sys

  • adm
  • uucp
  • mail
  • security
  • cron
  • printq
  • audit
  • ecs
  • nobody
  • usr


If the bos.compat.links fileset is installed, you can copy the
/etc/security/mkuser.defaults file over. If it is not installed, the
file belongs in the /usr/lib/security directory.


If you copy over mkuser.defaults, changes must be made to the stanzas.
Replace group with pgrp, and program with
shell
. A proper stanza should look like the following:


user:
pgrp = staff
groups = staff
shell = /usr/bin/ksh
home = /home/$USER


The following files may also be copied over, as long as the AIX version in the
new machine is the same:


/etc/security/login.cfg
/etc/security/user
NOTE: If you decide to copy these two files, open the
/etc/security/user
file and make sure that variables such as tty, registry, auth1 and so forth are
set properly with the new machine. Otherwise, do not copy these two files, and
just add all the user stanzas to the new created files in the new machine.


Once the files are moved over, execute the following:



usrck -t ALL
pwdck -t ALL
grpck -t ALL


This will clear up any discrepancies (such as uucp not having an entry in
/etc/security/passwd). Ideally this should be run on the source system
before
copying over the files as well as after porting these files to the new system.

NOTE: It is possible to find user ID conflicts when migrating users from
older versions of AIX to newer versions. AIX has added new user IDs in
different release cycles. These are reserved IDs and should not be deleted.
If your old user IDs conflict with the newer AIX system user IDs, it is advised
that you assign new user IDs to these older IDs.


http://www-01.ibm.com/support/docview.wss?uid=isg3T1000231

Labels

BlogCatalog