![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Creating user accounts | Redditt90kg | UNIX for Dummies Questions & Answers | 0 | 07-29-2006 06:44 PM |
| Limiting length of user in while creating user | Satya Mishra | AIX | 2 | 04-14-2005 11:40 PM |
| creating a new user | rocker40 | UNIX for Dummies Questions & Answers | 7 | 05-04-2004 01:33 PM |
| creating user accounts in AIX | pdepa | UNIX for Advanced & Expert Users | 3 | 01-16-2004 06:59 AM |
| creating a new user | Newbie4ever | UNIX for Dummies Questions & Answers | 3 | 07-27-2002 06:51 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
script for creating aix user
Hi Guys,
I want to create user with a script: user name, user id, primary group, group set, home directory, initial program, password, user information, another user can SU to user. And all the rest is the default. Does anyone already have the script for this? Can you please share it with me and the rest on the group. Thanks in advance, itik |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Hi,
Enter in command line: smitty user, choose Add a User. Then enter necessary information ie. name, groups etc. Finally press F6 and you'll get the complete script. Greets, Yac. |
|
#3
|
|||
|
|||
|
If you wish to automate user creation, first, as Yac suggests, create a user with "smitty user". Then copy the relevant parts of the smit.script and make them work for your needs.
|
|
#4
|
|||
|
|||
|
@prichard & Yac: Sorry, but i do not think it is that simple. To be useful such a script will have to deal with several error conditions. What you get out of "smitty user" is simply a wrapper for the "mkuser" command.
For instance assume the following situation: The script is called to create a user "foo" with UID 42. The following errors now could occur and should be reported back with different error levels from the script: - a user "foo" exists already with uid=42 (=the user exists) - a user "foo" exists with uid=43 (username already taken) - a user "bar" exists with uid=42 (userid already taken) - a user "foo" with uid=43 and a user "bar" with uid=42 exist already How about other errors, like (unsorted): the script not being called by root, unable to create the home directory, the username is not a legal one, the uid is not legal, ..... (and i don't even mention the errors connected with the group memberships) True, the last step would be to call "mkuser" and be done, but the necessary checks before look like an interesting programming task. I hope this helps. bakunin |
|
#5
|
|||
|
|||
|
I did not say it would be simple.
|
|
#6
|
|||
|
|||
|
Thank you for all your input.
I guess, I would be the first one to create the script. I'll share it when I'm done. It's hard adding hundreds of user manually or smitty, I really need to do it in a script. Is there a danger of editing manually all these files? /usr/lib/security/mkuser.default Contains the default values for new users. /etc/passwd Contains the basic attributes of users. /etc/security/user Contains the extended attributes of users. /etc/security/user.roles Contains the administrative role attributes of users. /etc/security/passwd Contains password information. /etc/security/limits Defines resource quotas and limits for each user. /etc/security/environ Contains the environment attributes of users. /etc/group Contains the basic attributes of groups. /etc/security/group Contains the extended attributes of groups. /etc/security/.ids Contains standard and administrative user IDs and group IDs. Last edited by itik; 04-10-2008 at 09:08 AM. |
|
#7
|
|||
|
|||
|
No, there is not, but IMHO it ist still preferable to do it with the AIX commands, namely mkuser.
I already attempted what you do now and can provide you with a script function to check some of the mentioned conditions. I will put it in here later this afternoon. bakunin |
|||
| Google The UNIX and Linux Forums |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|