Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default change password

    How can I change the password of a user from a "C" program
    Tushar Sinha Guest

  2. Similar Questions and Discussions

    1. How to change password
      I have inherited a contribute site from a former employee. He has not given us the administrator password to the site. How do I change it? ...
    2. How do you change the password?
      Hello, I am having trouble logging into the administrator account. I'm new at this program and I'm not sure how to open the program up at all! I've...
    3. Can't change password?
      Heya; I have PostGreSQL 7.3.4 on Mandrake Linux 9.2. For some reason Webmin, when I tell it to change the password of a pgsql user, acts like it's...
    4. NIS password change forcing
      Is it possible to implement password expiration with NIS? Or does anyone have some other suggestions for forcing the users to change passwords....
    5. netadmin & change password
      Hello, I have been reading about the change password function in NetAdmin (Win32). Now it says I need to input the old password. What is I am in...
  3. #2

    Default Re: change password

    [email]tusharsinha@adityabirla.com[/email] (Tushar Sinha) writes:
    > How can I change the password of a user from a "C" program
    I believe the usual solution is to run the "passwd" program and
    feed the correct data to it via a pipe or pty. See the "passwd
    chat" parameter of Samba, for example.

    If your program runs with root permissions, it can alter
    /etc/passwd or /etc/shadow directly; but then you need to
    carefully lock the file from other programs, and you won't
    know if the new password also has to be saved in other places,
    such as Samba or NIS.

    With Linux-PAM, the pam_chauthtok function may be able to change
    the password. I haven't tried it myself.
    Kalle Olavi Niemitalo Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139