LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-14-2009, 03:27 AM   #1
vivek rai
LQ Newbie
 
Registered: Jan 2009
Posts: 15

Rep: Reputation: 0
shell or perl script to change ftp user password


Hi,

Can anyone help me creating shell or perl script to change ftp user password.
 
Old 03-14-2009, 07:12 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060
Sure
Code:
su or sudo
passwd ftp
Gotta wonder, though, why it's got a password in the first place... (you should not need a password on ftp at all).
 
Old 03-14-2009, 08:51 AM   #3
vivek rai
LQ Newbie
 
Registered: Jan 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks, But i need a script to change password of ftp users through ftpaswword command, so that ftp users can change their own password through that script.
 
Old 03-14-2009, 05:02 PM   #4
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060
Oh, OK, looks like that can be done by the user; from the manual page,
Code:
ftpasswd --passwd --name=user --change-password
If you were going to do that with a shell program, it's a pretty straightforward process because the user's shell environment knows the user name so a one-liner would probably do; e.g.,
Code:
#!/bin/sh
#
# changeit
#
[path-to]ftpasswd --passwd --name=${USER} --change-password
It should prompt and that's pretty much that.

'Course you have to set it up first with the proper options, but that looks like it would do (and users really ought to know what their user name is and should be able to handle typing the above, eh?). Unless I'm missing something really basic, it seems like a shell or PERL program is, uh, overkill for the purpose.
 
Old 03-15-2009, 01:09 PM   #5
vivek rai
LQ Newbie
 
Registered: Jan 2009
Posts: 15

Original Poster
Rep: Reputation: 0
hi,
i need the script from which user can change their own password and the password location is /etc/proftp.passwd .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i change to super user then revert back to ordinary user ,using shell script? wrapster Solaris / OpenSolaris 6 03-18-2009 03:37 AM
In a perl script, how to test if user has sudo execute w/o password ? etomato Linux - Newbie 6 11-19-2008 10:18 PM
Shell script to change password kamal_aitin Linux - General 6 07-25-2007 12:09 AM
Can my shell script change the password of user ? prabhatsoni Linux - Software 1 05-27-2006 02:06 AM
how to assign password for a user in shell script mtest Programming 10 10-29-2003 06:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration