Sponsored Content
Full Discussion: Change of password
Top Forums Shell Programming and Scripting Change of password Post 302322360 by diogooute on Wednesday 3rd of June 2009 01:15:45 PM
Old 06-03-2009
I think that its possible.
I made some days ago a script to check if crontab contains my script and add him if it don't contains. When you script is in crontab u can use what i told you to send email. I was searching on google how to change password and i found a script that i guess will help you.
There is the example:
"
for USER in $(cat /tmp/users.txt) do
$(useradd $USER)
###Remove the space between 8 and )
PASSWORD=$(openssl rand -base64 8 )
###passwd [double dash] stdin
echo $PASSWORD | $(passwd –stdin $USER)
echo “$USER $PASSWORD” | mail -s “Your Account Info” $USER@company.com
sleep 3
done
"
You just don't need to read in the file like this script is doing, because u already know the user.

In the website that i found this script, the guy that made it explain a little more about it.

i haven't tested this script, because i am not in my home. Later i will try to do this in my home and come with a response if it do not work for you.

Another thing, about the password. I think you can use some variable like the month and make a calc with it to store on the computer. XOR is a good thing to make it, because you can have later you password encrypted, like a symmetric encrypt.

PS: the website that the script was found: Tip: Add User and Generate Password Script | PinoyTux Weblog
PS2: If this is not exactly what you want, sorry. My english is not so good but i am trying to help with what i understand about the problem. If u need something diferent, try to explain again.
PS3: I am not a expert in shell script, i am just a curious and helping with what i already know. If somebody know a better solution, post a better way to make me learn too.

I hope help you,
Diogo

Last edited by diogooute; 06-03-2009 at 11:39 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Change password by pushing encrypted password to systems

I'm tasked to change a user's password on multiple Linux systems (RH v3). I though copying the encrypted password from one Linux /etc/shadow file to another would work but I was wrong. The long term solution is to establish an openLDAP Directory service, but for now I'm stuck with a manual... (1 Reply)
Discussion started by: benq70
1 Replies

2. HP-UX

How I Can Change The Password

I need change the password a two user. what're the commands to complete this requerement (4 Replies)
Discussion started by: bobangarcia
4 Replies

3. UNIX for Advanced & Expert Users

change password ??

Hey all, How to reset the password to a given user id ?? I used passwd commands, but now for that user there are 2 passwords. i.e the old and new passwords. as : passwd mqcfaostt oldpassword : pass1 new password : pass2 Confirm new password : pass2 Now, su - mqcdaostt is working for... (4 Replies)
Discussion started by: varungupta
4 Replies

4. HP-UX

change password in one go

Hi all, I need to change the password of any user in one go. For example in Linux we have two options :- (echo "username:password") | chpasswd or echo $PASS | passwd $USER --stdin This changes the password without prompting. Actually, I need to make a script which adds a user and... (0 Replies)
Discussion started by: vikas027
0 Replies

5. Shell Programming and Scripting

change password in one go

Hi all, I need to change the password of any user in one go. For example in Linux we have two options :- (echo "username:password") | chpasswd or echo $PASS | passwd $USER --stdin This changes the password without prompting. Actually, I need to make a script which adds a user and... (5 Replies)
Discussion started by: vikas027
5 Replies

6. Shell Programming and Scripting

how to change root password using shell script with standard password

Hi Friends. I am new to scripting now i want to change the root password using the script with standard password. which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Discussion started by: kurva
2 Replies

7. Solaris

Solaris 8 - Asks for current root password when trying to change root password.

Hello All, I have several solaris boxes running Solaris 8. When changing root passwords on them, all will simply ask for the new root password to change and of course to re-type the new password. One of the systems however asks for the existing root password before it will display the new password... (8 Replies)
Discussion started by: tferrazz
8 Replies

8. UNIX for Dummies Questions & Answers

Help with Password Change

When I am trying to change the password of my account. I could see the following error: passwd: Changing password for ramu Enter existing login password: passwd: Sorry: less than 14 days since the last change. Permission denied Is anybody out there who can help me in changing my password? (4 Replies)
Discussion started by: bobby1015
4 Replies

9. AIX

Change password to blank password

AIX 6.1 User has a password set. It needs to be a blank password (no password). smit passwd enter user name at change password and confirm password, just press ENTER Afterwards, I could not log on with blank password or with original password. How can I change the password to a... (2 Replies)
Discussion started by: landog
2 Replies

10. Forum Support Area for Unregistered Users & Account Problems

Password sent via reset password email is 'weak' and won't allow me to change my password

I was unable to login and so used the "Forgotten Password' process. I was sent a NEWLY-PROVIDED password and a link through which my password could be changed. The NEWLY-PROVIDED password allowed me to login. Following the provided link I attempted to update my password to one of my own... (1 Reply)
Discussion started by: Rich Marton
1 Replies
vipw(1B)					     SunOS/BSD Compatibility Package Commands						  vipw(1B)

NAME
vipw - edit the password file SYNOPSIS
/usr/ucb/vipw DESCRIPTION
vipw edits the password file while setting the appropriate locks, and does any necessary processing after the password file is unlocked. If the password file is already being edited, then you will be told to try again later. The vi(1) editor will be used unless the environment variable VISUAL or EDITOR indicates an alternate editor. vipw performs a number of consistency checks on the password entry for root, and will not allow a password file with a "mangled" root entry to be installed. It also checks the /etc/shells file to verify the login shell for root. FILES
/etc/ptmp /etc/shells ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ SEE ALSO
passwd(1), vi(1), passwd(4), attributes(5) SunOS 5.10 14 Sep 1992 vipw(1B)
All times are GMT -4. The time now is 11:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy