bash: change my own password (without using root)

bash, linux, passwords

Solution

Of course there is, here is the tutorial of password in linux

and the solution is

Task: Set or Change User Password

Type passwd command as follows to change your own password:
$ passwd
Output:

Changing password for vivek
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

The user is first prompted for his/her old password, if one is present. This password is then encrypted and compared against the stored password. The user has only one chance to enter the correct password. The super user is permitted to bypass this step so that forgotten passwords may be changed.

A new password is tested for complexity. As a general guideline, passwords should consist of 6 to 8 characters including one or more from each of following sets:

    Lower case alphabetics
    Upper case alphabetics
    Digits 0 thru 9
    Punctuation marks

Problem

normally chpasswd does a great job at setting a users password. is there a way a non-privileged user may change their own password? i am interested in writing a gtk front end for this, it would be best if it also requires the users old password as well. ``` Change $user password? Old password [ ] new password [ ] new password again [ ] [cancel] [apply] ``` looking for ``` $command $enter:oldpass $enter:newpass password updated ```

Original source