July 11, 2020, 03:41:21 PM
collapse

* Site Menu

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

0 Members and 1 Guest are viewing this topic.

Offline Skhilled

  • Administrator
  • Hero Member
  • *
  • Posts: 3396
  • Attack: 34
    Defense: 43
    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 »

Offline Oldcrow

  • DS User
  • Sr. Member
  • *
  • Posts: 385
  • Attack: 100
    Defense: 100
    Attack Member
  • Gender: Male
  • One foot in the grave!
    • Coffeetimeunlimited.com
Re: Create Your Own Password Genetator In Bashrc!
« Reply #1 on: June 19, 2020, 11:47:15 AM »
How is this done? Where is bashrc

Offline Skhilled

  • Administrator
  • Hero Member
  • *
  • Posts: 3396
  • Attack: 34
    Defense: 43
    Attack Member
  • Gender: Male
  • Retro Gamer!
    • Buildz Hosting
Re: Create Your Own Password Genetator In Bashrc!
« Reply #2 on: June 19, 2020, 11:56:20 AM »
You must type in "whereis bashrc" in SSH and it will tell you exactly where the file is on your server. You will then have two options...

1.  If your control panel (WHM/cpanel, etc.) allows you to access and edit files you can locate it and edit it there. If you can't, there are tools/addons to allow you to do this.

2.  Use a good ssh/putty tool like MobaXterm. It also has options to view your files on the server as well as choosing a default editor to edit and save them. ;)

 

Page created in 0.084 seconds with 26 queries.