|
-
June 21st, 2001, 11:22 PM
#1
command line 'passwd' command
Hi..
what I need to do is this: change a user's password from a C program.
I am thinking on the lines of using the system() call to call this command, as I have used the same to create new users(system(useradd....))
the problem is the "passwd" command is interactive..is there any way I can specify the password(or output of
crypt(password,salt)) and remove the interactivity?
Gnome has the change password option..so I think there should be a way...
Thanks in advance!
ps. The "useradd" command was also interactive,but it had a -p option to specify the password (ie, output of crypt(password,salt) )while creating user so that removed the interactivity.
[This message has been edited by sujita (edited 06-21-2001).]
-
June 22nd, 2001, 10:16 PM
#2
Look into the chpass command and its -p switch instead of passwd.
Safe computing is a habit, not a toolkit.
-
June 25th, 2001, 03:26 AM
#3
hi,
thanks a lot.It works,though there's one minor hitch : only root can run chpasswd.Users can't change their passwords this way..any suggestions for this?
Sujita
-
June 25th, 2001, 10:06 PM
#4
There's no other commands I know of. If you can write it securely enough (and I'm not familiar enough with that side of Unix C programming to say whether or not it's possible) then you could get around it by writing a small program to just do the password change and make it SUID root. Of course, that requires a way to verify the user's identity that can't be spoofed, which is where the biggest catch would be.
Maybe someone else can suggest a better solution.
Safe computing is a habit, not a toolkit.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|