Linux / UNIX Tech Support Forum
This is a discussion on perl or shell script to change the password within the Shell scripting forums, part of the Development/Scripting category; i want a perl or shell script so that the user of ftp can change their won password....
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
| Sponsored Links | ||
|
|
|
||||
|
Perl code:
Code:
#!/usr/bin/perl
use Unix::PasswdFile;
$pw = new Unix::PasswdFile "/etc/passwd";
$pw->passwd("monk", $pw->encpass("My-New-Password"));
$pw->commit();
undef $pw;
Change root password using perl script? Shell script code: Code:
echo $PASSWORD | /usr/bin/passwd --stdin $USERNAME
__________________
Vivek Gite Linux Evangelist |
|
|||
|
Thankyou,
i have another question, i am using proftpd and my password file is in different location /etc/proft.passwd and i need shell script to change that password without changing /etc/passwd file. |
![]() |
| Tags |
| change password , passwd , perl , shell script |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Solaris Change User Password Using a Shell Script | vikas027 | Solaris/OpenSolaris | 1 | 13-06-2008 11:06 PM |
| Change root password using perl script? | Raj1 | Solaris/OpenSolaris | 8 | 13-06-2008 11:01 PM |
| let users change password using perl script? | james bond | Getting started tutorials | 9 | 24-05-2007 10:32 PM |
| Shell script to change folder directory owner after restore | marinm | Shell scripting | 5 | 23-01-2007 12:53 PM |
| HP UX user lock password, change password, password aging | rockdalinux | HP-UX | 0 | 20-12-2006 02:36 PM |