LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-10-2011, 08:37 AM   #1
prabhatsoni
Member
 
Registered: Oct 2004
Location: India
Distribution: FC 12
Posts: 233

Rep: Reputation: 30
Allowing user to change their system account password from intranet


Friends,
I have configured httpd web server to allow each of the system users to have their own web page (using UserDir directive).
At the same time I have configured ftp server to allow the users to upload their html files to the web server.
With above set up my users need not have any knowledge of linux; they can work from any windows PC on the network.
There is no problem in the above.

However, now I need to allow my users to change their passwords. The point here to note is that the users should be able to do this even from windows PC on the network.
One of the way is to configure a telnet server (or sshd). But I find that the windows PC does not have telnet client.
The other idea is that I should put a php script on the server which would take user name and password from the web page and then change the password. I don't know how can the system account password be changed through script - I will have to check this out.

Friends, does anyone have any other idea.


Thanks in advance.

Prabhat soni


Thanks in advance.
 
Old 01-10-2011, 09:05 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
It is more usual to allow a user to change their passwd. The usermod command can change every other setting on the user, but not the username. Your script will have to change their username in /etc/passwd, /etc/shadow, and /etc/group. You may also have a /etc/group.shadow. You may also want to change their home directories name to match the username. You will also need to add a sanity check to the username. Because these things need to be performed as root, a bad script could give the user root access.
 
Old 01-10-2011, 12:24 PM   #3
prabhatsoni
Member
 
Registered: Oct 2004
Location: India
Distribution: FC 12
Posts: 233

Original Poster
Rep: Reputation: 30
Now sir, I must confess I am a greenhorn :-(
I can't seem to make out what is being said in your reply.

My idea that I could change the password through a php script has come croppers because I realise the "chpasswd" command would have to be given as root.

However, your comments seems intriguing.
Perhaps you would be kind enough to be a little more elaborate. Or better still you could direct me to some writeup.


Thanks.

Prabhat.
 
Old 01-10-2011, 12:33 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You can use this cgi program that installs setuid root and thus allows users to change their password through a web interface, as they can do if they're logged into server.
You need to compile using "--disable-smbpasswd" and "--disable-squidpasswd", as you don't need them.

Regards
 
Old 01-14-2011, 03:27 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I misread your original post, or you may have edited it. I thought that you wanted to also change the username as well as the password.

Changing ones own password does not require root access because the passwd program is suid root. Technically, the effective user is root (EUID). The program is carefully written to only allow regular (REAL) users to change their own passwords.
 
  


Reply



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
RHEL 5 - User can't change password for OpenLDAP account cnzj Linux - Server 10 01-18-2011 06:09 PM
Locking out a user when password expires, but allowing them to change their password kaplan71 Linux - Security 5 06-27-2008 07:12 PM
Allowing user to change the password santhosh23 Linux - General 11 05-02-2007 12:36 AM
Password Change in SquirrelMail did not propogate to user login account kaplan71 Linux - Software 0 03-28-2007 08:48 AM
Can unlock screen with root password in my user account - want to change this sm1 Linux - Newbie 2 07-24-2005 05:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:00 AM.

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
Open Source Consulting | Domain Registration