LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Password generation with program from slackware 15 (https://www.linuxquestions.org/questions/slackware-14/password-generation-with-program-from-slackware-15-a-4175733282/)

Dominique* 01-28-2024 11:14 AM

Password generation with program from slackware 15
 
Is there a program in slackware 15.0 that I could use to generate 'safe' passwords from the commandline so that I can use it easily in scripts?
Firefox can ofcourse generate passwords, but I can't find any way to do this from the commandline.

marav 01-28-2024 11:20 AM

There are several ways to proceed

The simplest is to search on the web
For example:
https://www.howtogeek.com/30184/10-w...-command-line/

ponce 01-28-2024 11:27 AM

on slackbuilds.org there's pwgen that I use a lot at work: just install it from there then, for example, you can use the command
Code:

$ pwgen -sy 16 1
3l7Xog3Z>7Og1<nI

(have a look at "pwgen --help")

lvm_ 01-28-2024 11:27 AM

openssl rand -base64 <length>

mralk3 01-28-2024 11:35 AM

If you are looking for a way to store your passwords securely there is https://www.passwordstore.org/

It will generate secure passwords and store them in it's database
Code:

pass generate path/to/store/user 15

or

pass generate -n path/to/store/user 15

You can copy it to the clipboard if you are in a GUI:

Code:

pass -c path/to/store/user
I use it to store all my passwords. Even the short lived passwords for throw away accounts. It tracks it in a small git repo under ~/.password-store and can be made to use your gnupg key. So you can create strong passwords that are encrypted with gnupg.

Daedra 01-28-2024 12:40 PM

This will work, just tweak to your liking

Code:

openssl rand -base64 12 | tr -dc 'a-zA-Z0-9' | cut -c1-16

Windu 01-28-2024 01:32 PM

Quote:

Originally Posted by Daedra (Post 6479879)
This will work, just tweak to your liking

Code:

openssl rand -base64 12 | tr -dc 'a-zA-Z0-9' | cut -c1-16

Or use your system's own random generator (stolen from https://alien.slackbook.org/blog/sla...ocial-media/):
Code:

cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
In case you also want some special characters in the mix, try this instead:
Code:

cat /dev/urandom | tr -dc 'a-zA-Z0-9\-_.#!' | fold -w 32 | head -n 1
Note that the "fold" command takes a width parameter - change the "32" to the password length you are after.

j12i 01-28-2024 01:59 PM

If you really want to stay within what Slackware brings out of the box, there are two options right above. If SlackBuilds.org is within parameters, I like apg because it produces "pronouncable passwords".

gsl 01-28-2024 03:54 PM

Another out-of-the-box option is mkpasswd.expect (not to be confused with the mkpasswd from the whois package).

frankbell 01-28-2024 08:18 PM

My preferred password vault it keepassxc. It has very configurable password generation capabilities and the database is portable.

It's at Slackbuilds.org.

Lockywolf 01-28-2024 08:26 PM

makepasswd -l 32 -c "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"

makepasswd comes from

Code:

sudo $(which lwf_pkg-xattrs) $(which makepasswd)
getfattr: Removing leading '/' from absolute path names
# file: usr/bin/makepasswd
trusted.slackware_v1.makepkg.package_date="2023-05-24T14:52:24+00:00"
trusted.slackware_v1.makepkg.package_name="makepasswd-0.5.4-x86_64-1_sbotools20230524"
user.slackware_v1.installpkg.package_date="2023-05-24T14:52:42+00:00"
user.slackware_v1.installpkg.package_name="makepasswd-0.5.4-x86_64-1_sbotools20230524"



All times are GMT -5. The time now is 05:43 PM.