![]() |
| ||
| Change Password In A Shell Script Hi All, I have a problem. I need to write a shell script to change the password. The user may want to change his own password by this script. He will have to provide the required 3 parameters i.e. old password, new password and retype new password as arguments in command line. like, ./pass.sh old new new How do I do it. I am in a fix. :( I am not allowed to use expect etc. Please help me. Thanks. Asimananda |
| ||
| Re: Change Password In A Shell Script You shouldn't have to do it. Linux has this built in with passwd |
| ||
| Re: Change Password In A Shell Script i am using a shell script which changes the password of all the servers in the network and also of the host server (as per your requirement) but it uses except. Earlier i had a perl script to change the password. If you want i can give you both the scripts and you can modify them as per your requirement. Amit |
| ||
| Re: Change Password In A Shell Script Sounds like a class asignment. try a here document oldpw="$1" |
| ||
| Re: Change Password In A Shell Script Quote:
I would be very interested in your scripts. Would you mind sending them to me at . This sounds exactly what I am needing. Thanks PS |
| ||
| Re: Change Password In A Shell Script 1 Attachment(s) I have attached the modified script beacuse the original script is for changing the password across multiple servers and i guess this is not what you require. You need to execute the script from root user. It will create a log file in the directory from which you are executing the script. You can change the password for root and a user but you can do a small modification and the script will change the password for root and any user. Amit |
| ||
| Re: Change Password In A Shell Script Quote:
Hi Amit, Do you have a similar script (only ChangePasswd) in Perl? If you do can you please share it. Thanks, Vivek. |
| ||
| Re: Change Password In A Shell Script Hi Amit, I am looking for a script just like yours: I have many servers and I need to change their root psw. Could you post the entire script? thanks a lot Ezra Quote:
|
| ||
| Re: Change Password In A Shell Script Quote:
Im looking for the script which you have for changing password on multiple servers. Would you mind sending them to me at. Thanks and regards, VinodKumar |
| ||
| Re: Change Password In A Shell Script Quote:
I am trying to get a perl script to communicate with the passwd program. I do not have access to the modules expect or IO::Pty. I also do not have access to the expect utility. So far I have found a free pty/tty pair and opened them and set them to autoflush. Then I fork. In the child I close stdin, stdout and stderr to reopen them associated to the new tty handle and exec passwd. In the parent I want to read and write to the pty to interact with passwd. This is not working. The passwd direct access to the tty is not reaching my tty. Maybe I need to set the controling tty in the child before doing the exec? How do I do that? Cheers, sut |
| All times are GMT -4. The time now is 12:37 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC