ITEM: AG0161L
User ids in the range of 100 to 200.
Env:
AIX 3.2.5
Question:
Customer is moving users and data from another system. These
user ids are in the 100 to 200 range. Does AIX allow user ids
in the 100 to 200 range?
Response:
It is AIX's convention that normal user ids have a numeric value
greater than 200. This is convention only and is not enforced.
It is suggested that you do follow convention, but it is not
required. You will notice that there are at least two default
ids in AIX that fall into this range: guest(100) and lpd(104).
If the customer is restoring files from another UN*X system and
is concerned about the ownership of the files and getting that to
match the AIX user id, a short script could be written to make the
appropriate conversion for them.
Here is a short example that could be used to base the customer's
script on. Please be aware that this is an example only and IBM does
not provide technical support or give any warranty or guarantee for
this example. It is provided ASIS and any modifications would be the
responsibility of the user. This shell script does not do any error
checking. Error checking should be added to provide a fail safe script.
This would also be up to the user.
NOTE: This sample assumes that the users to be created are kept in a
file (/tmp/userids) in /etc/passwd-style format. It also assumes
that all user files have already been restored to the system in /home.
\#!/bin/ksh
IFS=:
while read uname trash uid trash2 trash3 home trash4
do
let new_uid=uid+100
echo "Creating $uname($uid/$new_uid)..."
mkuser -a id=$new_uid -a home=$home $uname
find $home -user $uid -exec chown $uname {} \\;
done \< /tmp/userids
/tmp/userids would have information similar to the following:
liz:!:108:1::/home/liz:/bin/ksh
This script will read in the data getting the username, user id, and
home directory and then create the user with an id 100 more than it
had originally. The script then uses the find command to find all
files that are owned by a userid of the original id and changes them
to be owned by the user (with the new id).
Support Line: User ids in the range of 100 to 200. ITEM: AG0161L
Dated: February 1995 Category: N/A
This HTML file was generated 99/06/24~13:30:28
Comments or suggestions?
Contact us