10-06-2001
Don't want to use useradd command to create a new user
I am doing manual addition of accounts. Actually I am writing a script and I am working on RedHat7.1 system. What I am trying to do is run the script and pass all the values of the username password and group as command line parameters. Now what I am trying to do is after passing the initial password I want the account to be activated with that password. Because if you simply edit the passwd file and add the username, password and other information when you test the account it does not recognize the account and then as a root user you have to go and enter the password again and then it gets written to the shadow file in encrypted form(even if you user command "pwconv" does not write the password to the shadow file in the encrypted form). P;us I can't leave the acconts open either. To create 500 account or more It will take me long a time to create those accounts. I just want to automate those password writing to the shadow file without having to go through this command
passwd <username>
enter new password in Unix ******
So, if anyone knows how can I do this through the script please let me know.
regards
-Iftikhar
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can any body help me to write a scripting program for entering a password at run time with out user interaction. (1 Reply)
Discussion started by: kumar_d
1 Replies
2. UNIX for Dummies Questions & Answers
I would like to change the password requirements for all our AIX 5.2 logins but am having trouble finding a place where I can set the rules for everyone at the same time. I know I can go user by user in smit passwords but is there a way to create rules for everyone at the same time?
Thanks,... (2 Replies)
Discussion started by: drathbone
2 Replies
3. UNIX for Advanced & Expert Users
hi all
i am writing a script to create user and group from the input given to script
for eg. script needs to values
1. mode - 1 or 2
2. id - if mode is 1 then id should be 2 char like x1 / v1 / v2
if mode is 2 then id should be 1 char like x / v / e
from these to values group is... (1 Reply)
Discussion started by: zedex
1 Replies
4. Solaris
Hi:
Could I set the:
- Login Time-out Interval
- Password History Count
- Lockout Duration
- Lockout Threshold
for user account in Sun Solaris 5.8.
Thanks for your help (6 Replies)
Discussion started by: mlsun
6 Replies
5. UNIX for Advanced & Expert Users
Hi,
I have installed open ldap according to the order from this video:
YouTube - bowendenning's Channel
sudo apt-get install slapd
sudo apt-get install ldap-utils
sudo apt-get install phpldapadmin
The installaion was good.
However it did NOT ask from me any password.
After I enter to... (0 Replies)
Discussion started by: programAngel
0 Replies
6. AIX
In AIX 5.3 tech level 11:
I want to setup a default password policy to have at least one
of each of the following: alpha character, numeric character, and "special"
character ("!", "&", etc).
The smitty Security and Users --> Passwords --> System Password
Policy screen only offers "MIN... (2 Replies)
Discussion started by: kikwit_phil
2 Replies
7. Solaris
Can anyone kindly explain to me the meaning of the default values of the code below please?
Thank you very much
#MINDIFF=3
#MINALPHA=2
#MINNONALPHA=1
#MINUPPER=0
#MINLOWER=0
#MAXREPEATS=0
#MINSPECIAL=0
#MINDIGIT=0
#WHITESPACE=YES (1 Reply)
Discussion started by: cjashu
1 Replies
8. SuSE
Hi,
I am setting password complexity in SLES 11. I am able to do most of things
pam-config -d --pwcheck
pam-config -a --cracklib
pam-config -a --cracklib-minlen=8
pam-config -a --cracklib-dcredit=-1
pam-config -a --cracklib-ocredit=-1
pam-config -a --pwhistory
pam-config -a... (1 Reply)
Discussion started by: solaris_1977
1 Replies
9. Solaris
Hi All,
I have a problem setting the password when I have to create a user and password as detailed below.
username : gaacj01 password : oshopp01
username : gaacj02 password : oshopp02
username : gaacj03 password : oshopp03
username : gaacj04 password : oshopp04
username : gaacj05 ... (17 Replies)
Discussion started by: kittigolf
17 Replies
10. HP-UX
I need to set password compliance for some servers in my company.
However, the requirements are that we need to set different password policies for 3 different user groups within the company. These are :
System Users: i.e root, etc
Batch/Application Users: oracle, bscs, etc
Standard User:... (0 Replies)
Discussion started by: anaigini45
0 Replies
pwconv(1M) System Administration Commands pwconv(1M)
NAME
pwconv - installs and updates /etc/shadow with information from /etc/passwd
SYNOPSIS
pwconv
DESCRIPTION
The pwconv command creates and updates /etc/shadow with information from /etc/passwd.
pwconv relies on a special value of 'x' in the password field of /etc/passwd. This value of 'x' indicates that the password for the user is
already in /etc/shadow and should not be modified.
If the /etc/shadow file does not exist, this command will create /etc/shadow with information from /etc/passwd. The command populates
/etc/shadow with the user's login name, password, and password aging information. If password aging information does not exist in
/etc/passwd for a given user, none will be added to /etc/shadow. However, the last changed information will always be updated.
If the /etc/shadow file does exist, the following tasks will be performed:
Entries that are in the /etc/passwd file and not in the /etc/shadow file will be added to the /etc/shadow file.
Entries that are in the /etc/shadow file and not in the /etc/passwd file will be removed from /etc/shadow.
Password attributes (for example, password and aging information) that exist in an /etc/passwd entry will be moved to the corre-
sponding entry in /etc/shadow.
The pwconv command can only be used by the super-user.
FILES
/etc/opasswd
/etc/oshadow
/etc/passwd
/etc/shadow
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
passwd(1), passmgmt(1M), usermod(1M), passwd(4), attributes(5)
DIAGNOSTICS
pwconv exits with one of the following values:
0 SUCCESS.
1 Permission denied.
2 Invalid command syntax.
3 Unexpected failure. Conversion not done.
4 Unexpected failure. Password file(s) missing.
5 Password file(s) busy. Try again later.
6 Bad entry in /etc/shadow file.
SunOS 5.10 9 Mar 1993 pwconv(1M)