2

Just run it until it works (in a newer version of bash that supports the =~ for regex matching): unset pass; until [[ \ $pass =~ [0-9].*[0-9] && $pass =~ [A-Z].*[A-Z] && $pass =~ [^A-Za-z0-9] \ ]]; do pass=$(LC_ALL=C pwgen -c -n -y -B 12 1) done For example: $ unset pass; until [[ $pass =~ [0-9].*[0-9] ...


2

create a file ~/.my.cnf, make it only accessible by yourself, permission 600. [client] user=myuser password=mypassword Then you don't need type password any more. bash$ mysql -u myuser mydatabase mysql>


1

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: OPTIONS [...] minlen=n Set a minimum password ...


1

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:]])' A09B?~WR~$#J


1

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 ...


1

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 ...


1

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 root@freebsd:~...


1

Expect scripts must be run with expect as expect <script_name> Running them as shell scripts with sh <script_name> Was the cause of the problem.


1

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 ...


Only top voted, non community-wiki answers of a minimum length are eligible