Sponsored Content
Full Discussion: sed assistance
Top Forums Shell Programming and Scripting sed assistance Post 303003227 by drl on Sunday 10th of September 2017 06:48:53 AM
Old 09-10-2017
Hi.

For password generation, see also:
Code:
apg     generates several random passwords (man)
Path    : /usr/bin/apg
Length  : 15 lines
Type    : Bourne-Again shell script, ASCII text executable
Shebang : #!/bin/bash
Repo    : Debian 8.8 (jessie) 

pwgen   generate pronounceable passwords (man)
Path    : /usr/bin/pwgen
Type    : ELF 64-bit LSB executable, x86-64, version 1 (SYSV ...)
Repo    : Debian 8.8 (jessie)

For a system like:
Code:
OS, ker|rel, machine: Linux, 3.16.0-4-amd64, x86_64
Distribution        : Debian 8.8 (jessie)

as well as some others, e.g. Fedora, Debian-based systems.

Best wishes ... cheers, drl
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

need assistance: sed and repeating patterns

hi, I need to write a command with sed to find all the lines in a file that contain patterns of three or more characters that repeat once and put them inside perenthezes. I cannot tell sed what pattern to look for. it should find repeated patterns automatically. example:... (1 Reply)
Discussion started by: metalwarrior
1 Replies

2. UNIX for Advanced & Expert Users

assistance requested (sed related)

I gotta write a command to change the accounts in /etc/passwd that use a shell other than the bash to bash shell. those accounts that dont use a shell shouldnt get modified. assuming all the shell programs end in sh and other programs dont. and the result should go into /etc/passwd.rev any hint? (4 Replies)
Discussion started by: metalwarrior
4 Replies

3. Shell Programming and Scripting

Need assistance with appending strings using sed and variables

HI, Can't seem to find anything on the forums to fix this. I have a file, one line within this will not have a specific string at the end. I have the string, but need to append it to the specific line which has it missing. I need to use a variable for this, $string - I am using double... (13 Replies)
Discussion started by: mandriver
13 Replies

4. Shell Programming and Scripting

sed search and replace word assistance...

Hi, I am trying to write a shell script designed to take input line by line by line from a file with a word on each line for editing with sed. Example file: 1.ejverything 2.bllown 3.maikling 4.manegement 5.existjing 6.systems My design currently takes input from the user, and... (2 Replies)
Discussion started by: mkfitzwilliams
2 Replies

5. Shell Programming and Scripting

Need assistance with sed

Hi All, I need your assistance, I would like to replace all lines beginning with the word "begin" with the below text: Device | IPMB0-A | IPMB0-B Board Address |Sent SentErr %Errr |Sent SentErr ... (9 Replies)
Discussion started by: Dendany83
9 Replies

6. UNIX for Advanced & Expert Users

Need assistance with sed

Hi All, I need your assistance, I would like to replace all lines beginning with the word "begin" with the below text: Device | IPMB0-A | IPMB0-B Board Address |Sent SentErr %Errr |Sent SentErr ... (10 Replies)
Discussion started by: Dendany83
10 Replies

7. Shell Programming and Scripting

sed newbie scripting assistance

Howdy folks, I'm trying to craft a log file summarisation tool for an application that creates a lot of duplicate entries with only a different suffix to indicate point of execution. I thought I'd gotten close but I'm clearly missing something. Here's a genericized version: A text_file... (3 Replies)
Discussion started by: mthespian
3 Replies

8. UNIX for Dummies Questions & Answers

Sed/command assistance

Hello all, I need some help and education creating a script. Basically I have a file with a list of numbers.. 2125554444 2124445555 I need to put them into a format that looks like this.... UQ-V8.1,2125554444,hdaudio UQ-V8.1,2124445555,hdaudio Any help would be greatly... (6 Replies)
Discussion started by: jay11789
6 Replies

9. UNIX for Dummies Questions & Answers

Sed/command assistance

Hello, I'm attempting to play with sed commands again... I have a file named test1 with numbers...ex:5551234567 I run this sed on the file... cat test1 | sed 's/^/homeDnModify "/g' | sed 's/$/" "" 3/g' >test2 Im hoping it will look like this... homeDnModify "551235" "4567" ""... (5 Replies)
Discussion started by: jay11789
5 Replies

10. UNIX for Beginners Questions & Answers

Assistance required to decode sed search using /1

Hi, I am trying to extract line number (first number), as well as everything from TSVal onwards. 4 1.474005 172.18.124.142 -> 74.125.228.46 TCP 2450940617 74 44021 > https Seq=0 Win=5840 Len=0 MSS=1380 SACK_PERM=1 TSval=2450940617 TSecr=0 WS=64 6 1.488149 172.18.124.142 ->... (1 Reply)
Discussion started by: sand1234
1 Replies
APG(1)								    User Manual 							    APG(1)

NAME
apg - generates several random passwords SYNOPSIS
apg [-a algorithm] [-M mode] [-E char_string] [-n num_of_pass] [-m min_pass_len] [-x max_pass_len] [-r dictfile] [-b filter_file] [-p min_substr_len] [-s] [-c cl_seed] [-d] [-y] [-l] [-t] [-q] [-h] [-v] DESCRIPTION
apg generates several random passwords. It uses several password generation algorithms (currently two) and a built-in pseudo random number generator. Default algorithm is pronounceable password generation algorithm designed by Morrie Gasser and described in A Random Word Generator For Pronounceable Passwords National Technical Information Service (NTIS) AD-A-017676. The original paper is very old and had never been put online, so I have to use NIST implementation described in FIPS-181. Another algorithm is simple random character generation algorithm, but it uses four user-defined symbol sets to produce random password. It means that user can choose type of symbols that should appear in password. Symbol sets are: numeric symbol set (0,...,9) , capital letters symbol set (A,...,Z) , small letters symbol set (a,...,z) and special symbols symbol set (#,@,!,...). Built-in pseudo random number generator is an implementation of algorithm described in Appendix C of ANSI X9.17 or RFC1750 with exception that it uses CAST or SHA-1 instead of Triple DES. It uses local time with precision of microseconds (see gettimeofday(2)) and /dev/random (if available) to produce initial random seed. apg also have the ability to check generated password quality using dictionary. You can use this ability if you specify command-line options -r dictfile or -b filtername where dictfile is the dictionary file name and filtername is the name of Bloom filter file. In that dictionary you may place words (one per line) that should not appear as generated passwords. For example: user names, common words, etc. You even can use one of the dictionaries that come with dictionary password crackers. Bloom filter file should be created with apgbfm(1) utility included in apg distribution. In future releases I plan to implement some other techniques to check passwords (like pattern check) just to make life easier. OPTIONS
Password generation modes options -a algorithm use algorithm for password generation. 0 - (default) pronounceable password generation 1 - random character password generation -n num_of_pass generate num_of_pass number of passwords. Default is 6. -m min_pass_len generate password with minimum length min_pass_len. If min_pass_len > max_pass_len then max_pass_len = min_pass_len. Default mini- mum password length is 8. -x max_pass_len generate password with maximum length max_pass_len. If min_pass_len > max_pass_len then max_pass_len = min_pass_len. Default maxi- mum password length is 10. -M mode Use symbolsets specified with mode for password generation. mode is a text string consisting of characters S, s, N, n, C, c, L, l. Where: S generator must use special symbol set for every generated password. s generator should use special symbol set for password generation. N generator must use numeral symbol set for every generated password. n generator should use numeral symbol set for password generation. C generator must use capital symbol set for every generated password. c generator should use capital symbol set for password generation. L generator must use small letters symbol set for every generated password (always present if pronounceable password generation algorithm is used). l generator should use small letters symbol set for password generation. R,r not supported any more. Use -E char_string option instead. mode can not be more than 4 characters in length. Note: Usage of L, M, N, C will slow down password generation process. Examples: -M sncl or -M SNCL or -M Cn -E char_string exclude characters in char_string from password generation process (in pronounceable password generation mode you can not exclude small letters). To include special symbols that can be recognized by shell (apostrophe, quotes, dollar sign, etc.) in char_string use the backslashed versions. Examples: Command apg -a 1 -M n -n 3 -m 8 -E 23456789 will generate a set of passwords that will look like this 10100110 01111000 11011101 Command apg -a 1 -M nc -n 3 -m 26 -E GHIJKLMNOPQRSTUVWXYZ will generate a set of passwords that will look like this 16A1653CD4DE5E7BD9584A3476 C8F78E06944AFD57FB9CB882BC 8C8DF37CD792D36D056BBD5002 Password quality control options -r dictfile check generated passwords for their appearance in dictfile -b filter_file check generated passwords for their appearance in filter_file. filter_file should be created with apgbfm(1) utility. -p min_substr_len this option tells apg(1) to check every substring of the generated password for appearance in filter_file. If any of such substrings would be found in the filter_file then generated password would be rejected and apg(1) will generate another one. min_substr_len specifies minimum substring length to check. This option is active only if -b option is defined. Pseudo random number generator options -s ask user for random sequence for password generation -c cl_seed use cl_seed as a random seed for password generation. I use it when i have to generate passwords in a shell script. Password output options -d do NOT use any delimiters between generated passwords. I use it when i have to generate passwords in a shell script. -y print generated passwords and crypted passwords (see man crypt(3)) -q quiet mode (do not print warnings) -l spell genetated passwords. Useful when you want to read generated password by telephone. WARNING: Think twice before read your password by phone. -t print pronunciation for generated pronounceable password -h print help information and exit -v print version information and exit DEFAULT OPTIONS
apg -a 0 -M sncl -n 6 -x 10 -m 8 (new style) If you want to generate really secure passwords, you should use option -s. To simplify apg usage, you can write a small shell script. For example: [begin]----> pwgen.sh #!/bin/sh /usr/local/bin/apg -m 8 -x 12 -s [ end ]----> pwgen.sh EXIT CODE
On successful completion of its task, apg will complete with exit code 0. An exit code of -1 indicates an error occurred. Textual errors are written to the standard error stream. DIAGNOSTICS
If /dev/random is not available, apg will display a message about it. FILES
None. BUGS
None. If you've found one, please send bug description to the author. SEE ALSO
apgbfm(1) AUTHOR
Adel I. Mirzazhanov, <a-del@iname.com> Project home page: http://www.adel.nursat.kz/apg/ Automated Password Generator 2003 Aug 04 APG(1)
All times are GMT -4. The time now is 04:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy