QUICK NEWS

{NEW} - A new css video is up.

{OLD} - New video courtesy of Skhilled, Thanks for posting it up.

Video of the moment:


Internal Links

SMF Sites

Quick Info

Create Your Own Password Generator In Bashrc

Started by Skhilled, Sep 15, 2019, 01:25 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Skhilled

No more going to other sites to generate random passwords! Just add the following code below to bashrc. In any ssh terminal use the following code to find out where bashrc resides:

whereis bashrc
Open it in your favorite editor and add the following code to the bottom of the file:

function pass()
 {
     if [ "$#" -ne 1 ]; then
         count=15
     else
         count=$1
     fi

     pass=`</dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${count}`
     echo $pass
 }

Reboot your session then type "pass" which will give you a random 15 character password. You can change the length of the password by specifying a parameter such as "pass 20" which will generate a random 20 character password. :vcool