November 21, 2019, 05:14:52 PM
collapse

* Site Menu

Author Topic: Create Your Own Password Genetator In Bashrc!  (Read 112 times)

0 Members and 1 Guest are viewing this topic.

Offline Skhilled

  • Administrator
  • Hero Member
  • *
  • Posts: 3238
  • Attack: 100
    Defense: 100
    Attack Member
  • Gender: Male
  • Retro Gamer!
    • Buildz Hosting
Create Your Own Password Genetator In Bashrc!
« on: September 15, 2019, 02:26:34 PM »
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:

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

Code: [Select]
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.
« Last Edit: September 15, 2019, 02:31:49 PM by Skhilled »

 

Page created in 0.052 seconds with 25 queries.