/ / bash: zmienia moje własne hasło (bez używania roota) [zamknięte] - linux, bash, hasła

bash: zmień moje własne hasło (bez użycia root) [closed] - linux, bash, passwords

normalnie chpasswd wykonuje świetną robotę przy ustawianiu hasła użytkownika.

Czy istnieje sposób, w jaki użytkownik nieuprzywilejowany może zmienić swoje hasło?

interesuje mnie pisanie frontonu gtk w tym celu, byłoby najlepiej, gdyby wymagało również starego hasła użytkownika.


Change $user password?

Old password [         ]

new password [         ]
new password again [         ]

[cancel]               [apply]

szukam

$command
$enter:oldpass
$enter:newpass
password updated

Odpowiedzi:

7 dla odpowiedzi № 1

Oczywiście jest, oto tutorial dotyczący hasła w linux

i rozwiązanie jest

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