command line password generator from the whm/cpanel UI
Inside the cPanel/WHM interface, you are able to use passwords that are generated by the cPanel/WHM interface. Is there something that I can run in the command line to generate a password using the same system/generator as this UI in the cPanel/WHM interface?
-
Hey there! I'm not currently finding a way to do this on my end, so it doesn't look like we have a tool readily-available to perform this work. This would be an excellent feature request if you'd like to submit one using the link in my signature, and I can bring it up with the team during our meeting next week. 0 -
If you want to generate random passwords in the clear you can do this in Python. Just change the range value. Reference:
Use martinheinz.dev. [CODE=python]# pip install xkcdpass from xkcdpass import xkcd_password as xp word_file = xp.locate_wordfile() words = xp.generate_wordlist(wordfile=word_file, min_length=5, max_length=10) for i in range(4): print(xp.generate_xkcdpassword(words, acrostic="python", numwords=6, delimiter="*"))
You can also use openssl. Change 12 incut-c1-12
to the length you want. You will also need to change the number behind base64 to be a few more bytes above the desired password length. Reference:
Or save in a file and drop it in your /usr/local/bin and make sure that is in your path so you can run it anywhere from the system. (make sure to chmod +x filename to make it executable). [CODE=bash]#!/bin/bash LENGTH=25 if [ ! -z "$1" ] && [ $1 -gt 1 ]; then LENGTH=$1 fi NUMBYTES=`echo $LENGTH | awk '{print int($1*1.16)+1}'` openssl rand -base64 $NUMBYTES | tr -d "=+/" | cut -c1-$LENGTH0
Please sign in to leave a comment.
Comments
2 comments