Is is possible to run the passwd command with an option to show the newly entered passwords? By default it doesn't show what I type and I don't want this.[dave@hal9000 ~]$ passwd Changing password for user dave.Changing password for dave.(current) UNIX password: New password: bowmanRetype new password: bowmanpasswd: all authentication tokens updated successfully.
show entered new password in unix passwd command
command line;password;passwd
If you really want to go this path and there's no passwd parameter, you can use this Expect script:#!/usr/bin/env expect -fset old_timeout $timeoutset timeout -1stty -echosend_user Current password: expect_user -re (.*)\nset old_password $expect_out(1,string)stty echosend_user \nNew password: expect_user -re (.*)\nset new_password $expect_out(1,string)set timeout $old_timeoutspawn passwdexpect password:send $old_password\rexpect password:send $new_password\rexpect password:send $new_password\rexpect eofHow it works:[dave@hal9000 ~]$ ./passwd.tclCurrent password: New password: bowmanspawn passwdChanging password for user dave.Changing password for dave.(current) UNIX password: New password: Retype new password: passwd: all authentication tokens updated successfully.This shell script might also work (tested on Fedora 20 with bash-4.2.47-2 and passwd-0.79-2):#!/bin/shstty -echoecho -n Current password: read old_passwordstty echoechoecho -n New password: read new_passwordpasswd << EOF$old_password$new_password$new_passwordEOFHow it works:[dave@hal9000 ~]$ ./passwd.shCurrent password: New password: bowmanChanging password for user dave.Changing password for dave.(current) UNIX password: New password: Retype new password: passwd: all authentication tokens updated successfully.