12-15-2010
It is not possible to directly set a specific password for a unix account with standard unix commands.
Your earlier posts suggest that you may know the correct value for the password "salt" without stating that value. Afaik the "crypt" program has nothing to do with passwords. Afaikn you would need knowledge of the correct "salt" value and a custom "C" language program to produce a valid encrypted password and then (as "vishalaswani" notes) some skilled editing to modify the shadow file.
I have a "C" program to set a unix password to a given value but there is no way that I would publish such a program on the Internet.
As "dangral" suggests, consider using the "passwd" command.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am on Fedora 4 and using VI. I need to add users from a text file. ANYONE? plz help me out here. I am already going bald, dont need anymore hair to fall out.
Joshua (2 Replies)
Discussion started by: Neece29
2 Replies
2. Shell Programming and Scripting
Hello guys, I would appreciate if someone can help me for this task:
I have a large txt file that contains lots of user ids in different format. I need to run this against a database output ldif file and print to a file whether they exist or not. And if they exist then I need to print their... (9 Replies)
Discussion started by: cmontr
9 Replies
3. Shell Programming and Scripting
could you please find a solution for this
script that checks if any of a list of users given on the command line is logged in. For each user the script should say whether this user is logged in or not. The script prints an error message if no parameter is given. And ask the user to enter a name... (3 Replies)
Discussion started by: anything
3 Replies
4. Shell Programming and Scripting
I need a script to validate and add more than one user at one time
Field 1 - FirstName LastName Field 2 - userid Field 3 - email address Field 4 - department
Validation for Field 1
No... (3 Replies)
Discussion started by: karthikn7974
3 Replies
5. OS X (Apple)
Hello everyone,
Not sure if this is the right place, but OS X isn't your standard Unix, so I figured here would be best. I am looking at creating a script that will be interactive that admins can run to create users.
Now, 10.4 uses netinfo database and netinfo manager to handle it's users. ... (3 Replies)
Discussion started by: tlarkin
3 Replies
6. Shell Programming and Scripting
Hi everybody,
i need help from all of you.
I have many users who are no more work in our Company. Some who get objects are Locked. There Many users and many Database Servers. And it'll take long for me to finished this job.
That's why i need your help to provide me anyone Scripts... (2 Replies)
Discussion started by: Sonson
2 Replies
7. UNIX for Dummies Questions & Answers
Hi All i have written the script to add 10000 users, when i execute the script it had no errors ,but the script is not adding the users.
pls correct me. i want it using while loop
#!bin/sh
count=0
while
do
useradd username$count
count=`expr $count + 1`
done
~ (2 Replies)
Discussion started by: kalyankalyan
2 Replies
8. Shell Programming and Scripting
hi I need a shell script which runs perpetually in background and monitors different aspects of different users on different files and their usages
for example say there r 3 users
so i want when they log in i.e. their log in time and their file access, modify and change log of each file of a... (3 Replies)
Discussion started by: rrd1986
3 Replies
9. Shell Programming and Scripting
echo -e "Enter in a username : \c"
read username
grep "^$username:" /etc/passwdWhat I'm trying to do is take in a username from my script and I need to be able to check if that username already exists. If it does the script should display a message saying that the user already exists and exit.
... (2 Replies)
Discussion started by: shadowcat
2 Replies
10. Shell Programming and Scripting
Well, sudo is a great tool for delegating permissions among admins. But, it's really hard to find a great tool which would give an interactive way of editing /etc/sudoers file. Now, when I say "editing", I really refer to add new groups, users, aliases in the /etc/sudoers file. visudo is great... (2 Replies)
Discussion started by: admin_xor
2 Replies
LEARN ABOUT REDHAT
sslpasswd
PASSWD(1) OpenSSL PASSWD(1)
NAME
passwd - compute password hashes
SYNOPSIS
openssl passwd [-crypt] [-1] [-apr1] [-salt string] [-in file] [-stdin] [-noverify] [-quiet] [-table] {password}
DESCRIPTION
The passwd command computes the hash of a password typed at run-time or the hash of each password in a list. The password list is taken
from the named file for option -in file, from stdin for option -stdin, or from the command line, or from the terminal otherwise. The Unix
standard algorithm crypt and the MD5-based BSD password algorithm 1 and its Apache variant apr1 are available.
OPTIONS
-crypt
Use the crypt algorithm (default).
-1 Use the MD5 based BSD password algorithm 1.
-apr1
Use the apr1 algorithm (Apache variant of the BSD algorithm).
-salt string
Use the specified salt. When reading a password from the terminal, this implies -noverify.
-in file
Read passwords from file.
-stdin
Read passwords from stdin.
-noverify
Don't verify when reading a password from the terminal.
-quiet
Don't output warnings when passwords given at the command line are truncated.
-table
In the output list, prepend the cleartext password and a TAB character to each password hash.
EXAMPLES
openssl passwd -crypt -salt xx password prints xxj31ZMTZzkVA.
openssl passwd -1 -salt xxxxxxxx password prints $1$xxxxxxxx$UYCIxa628.9qXjpQCjM4a..
openssl passwd -apr1 -salt xxxxxxxx password prints $apr1$xxxxxxxx$dxHfLAsjHkDRmG83UXe8K0.
0.9.7a 2002-10-03 PASSWD(1)