Just run it until it works (in a newer version of bash that supports the =~ for regex matching):
until [[ \
$pass =~ [0-9].*[0-9] &&
$pass =~ [A-Z].*[A-Z] &&
$pass =~ [^A-Za-z0-9] \
pass=$(LC_ALL=C pwgen -c -n -y -B 12 1)
$ unset pass; until [[ $pass =~ [0-9].*[0-9] ...
create a file ~/.my.cnf, make it only accessible by yourself, permission 600.
Then you don't need type password any more.
bash$ mysql -u myuser mydatabase
Pluggable Authentication Modules (PAM) is a (not really) newer generic API for authentication originally proposed by Sun Microsystems in 1995 and adapted a year later on the Linux ecosystem. With an API change, don't expect things to keep the same name (nor to always map exactly the same).
from man pam_unix:
Set a minimum password ...
if you have GNU grep with Perl mode installed, this can generate a password as per constraints.
$ < /dev/urandom \
tr -cd '[:alnum:][:punct:]' | fold -w 12 |
grep -Pm1 '(?=.*[[:upper:]].*[[:upper:]])(?=.*[[:digit:]].*[[:digit:]])(?=.*[[:punct:]])'
This is mentioned in a comment above, but I think it deserves to be its own answer.
For people receiving the Permission denied (publickey) error despite the other solutions here, the problem is likely that the server is set not to accept passwords. To change this, you need to get into the server (many services will allow you to access with a password via a ...
Your question is unclear because you don't specify the specific password field you are trying to view. Most applications allow you to see the password easily directly.
As for the rest of them, assuming they don't encrypt it, you may be able to find it in their configuration files.
Lastly, for browser password fields you can easily view 99% percent of them by ...
TCSH does not support anything like this. The whole history of a shell session is merged to the history file when the shell is closed.
It is possible to skip a command from being added to the history file, however, by spawning another TCSH shell and unsetting savehist:
root@freebsd:~ # csh
root@freebsd:~ # echo First shell: $$
First shell: 7143
This is relevant for FreeBSD, since htpasswd isn't available without installing apache. Building on @meuh's answer, here's how to use Python3 in FreeBSD to get a bcrypt hash of a password - for example, for basic auth in a traefik jail.
Note the following assumes a jail. Be careful with pip if this is the base OS. Adjust for version of Python3 depending on ...