LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-28-2024, 11:14 AM   #1
Dominique*
LQ Newbie
 
Registered: May 2021
Posts: 14

Rep: Reputation: Disabled
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.
 
Old 01-28-2024, 11:20 AM   #2
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,409

Rep: Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142
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/
 
Old 01-28-2024, 11:27 AM   #3
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,118

Rep: Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192
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")
 
4 members found this post helpful.
Old 01-28-2024, 11:27 AM   #4
lvm_
Member
 
Registered: Jul 2020
Posts: 965

Rep: Reputation: 342Reputation: 342Reputation: 342Reputation: 342
openssl rand -base64 <length>
 
1 members found this post helpful.
Old 01-28-2024, 11:35 AM   #5
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,904

Rep: Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053
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.
 
2 members found this post helpful.
Old 01-28-2024, 12:40 PM   #6
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,699

Rep: Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381
This will work, just tweak to your liking

Code:
openssl rand -base64 12 | tr -dc 'a-zA-Z0-9' | cut -c1-16
 
2 members found this post helpful.
Old 01-28-2024, 01:32 PM   #7
Windu
Member
 
Registered: Aug 2021
Distribution: Arch Linux, Debian, Slackware
Posts: 594

Rep: Reputation: Disabled
Quote:
Originally Posted by Daedra View Post
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.
 
Old 01-28-2024, 01:59 PM   #8
j12i
Member
 
Registered: Nov 2013
Location: UTC+1
Distribution: Slackware64 15.0
Posts: 160

Rep: Reputation: Disabled
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".
 
2 members found this post helpful.
Old 01-28-2024, 03:54 PM   #9
gsl
Member
 
Registered: Jun 2007
Location: Australia
Distribution: Slackware
Posts: 76

Rep: Reputation: 44
Another out-of-the-box option is mkpasswd.expect (not to be confused with the mkpasswd from the whois package).
 
1 members found this post helpful.
Old 01-28-2024, 08:18 PM   #10
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,361
Blog Entries: 28

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

It's at Slackbuilds.org.
 
1 members found this post helpful.
Old 01-28-2024, 08:26 PM   #11
Lockywolf
Member
 
Registered: Jul 2007
Posts: 683

Rep: Reputation: 253Reputation: 253Reputation: 253
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"
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Keepass - Password generation length SlowCoder Linux - Security 9 04-15-2022 10:59 PM
LDAP password generation cele_82 Linux - Security 2 05-12-2014 08:15 AM
[SOLVED] uuencode for random password generation with /dev/urandom JZL240I-U SUSE / openSUSE 27 09-06-2007 01:00 AM
Password generation failed for scheme {CRYPT}: scheme not recognized olva Linux - General 0 11-05-2006 11:21 AM
Strong password generation Lindy Linux - Software 2 12-27-2003 07:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration