summaryrefslogtreecommitdiffstats
path: root/ranpwd.1
blob: 19417139ece60730f403ffa58a981c630fcf0d90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
.\" -----------------------------------------------------------------------
.\"   
.\"   Copyright 1994-2008 H. Peter Anvin - All Rights Reserved
.\"
.\"   This program is free software; you can redistribute it and/or modify
.\"   it under the terms of the GNU General Public License as published by
.\"   the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
.\"   Boston MA 02110-1301, USA; either version 2 of the License, or
.\"   (at your option) any later version; incorporated herein by reference.
.\"
.\" -----------------------------------------------------------------------
.TH RANPWD 1 "28 June 2008" "H. Peter Anvin"
.SH NAME
ranpwd \- generate random passwords
.SH SYNOPSIS
.B ranpwd
[options] [length]
.SH DESCRIPTION
.B ranpwd
generates random passwords.  On Linux, it will use the kernel-based
true random number generator to generate cryptographically secure
passwords.
.PP
If
.I length
is not given, it defaults to 8 characters unless specified below.
.SS OPTIONS
.TP
.BR "\-\-ascii"
Allow any printable ASCII character except space.  This is the default.
.TP
.BR "\-a" , "\-\-alphanum"
Generate mixed-case alphanumeric passwords.
.TP
.BR "\-l" , "\-\-alphanum \-\-lower"
Generate lower-case alphanumeric passwords.
.TP
.BR "\-u" , "\-\-alphanum \-\-upper"
Generate upper-case alphanumberic passwords.
.TP
.BR "\-A", "\-\-alpha"
Generate mixed-case alphabetic passwords.
.TP
.BR "\-L" , "\-\-alpha \-\-lower"
Generate lower-case alphabetic passwords.
.TP
.BR "\-U" , "\-\-alpha \-\-upper"
Generate upper-case alphabetic passwords.
.TP
.BR "\-x" , "\-\-hexadecimal \-\-lower"
Generate lower-case hexadecimal numbers.
.TP
.BR "\-X" , "\-\-hexadecimal \-\-upper"
Generate upper-case hexadecimal numbers.
.TP
.BR "\-d" , "\-\-decimal"
Generate decimal numbers.
.TP
.BR "\-o" , "\-\-octal"
Generate octal numbers.
.TP
.BR "\-b" , "\-\-binary"
Generate a bit string (for Bynar sabotage teams.)
.TP
.BR "\-i" , "\-\-ip"
Generate a random IP suffix (normally used with a
.I 169.254.
prefix).  The first octet cannot be 0 or 255.  Length is given in
octets; the default is two octets.
.TP
.BR "\-m" , "\-\-mac-address"
Generate a random MAC address.  The first octet must have the
multicast bit clear, and the local bit set.  Length is given in
octets; the default is six octets.
.TP
.BR "\-M" , "\-\-mac-address \-\-upper"
Generate an upper case random MAC address.  The first octet must have the
multicast bit clear, and the local bit set.  Length is given in
octets; the default is six octets.
.TP
.BR "\-g" , "\-\-uuid" , "\-\-guid"
Generate a random Universally Unique Identifier (UUID).  Length is
given in the number of UUIDs to output; the default is one UUID.
.TP
.BR "\-g" , "\-\-uuid \-\-upper" , "\-\-guid \-\-upper"
Generate an upper case random Universally Unique Identifier (UUID).
Length is given in the number of UUIDs to output; the default is one
UUID.
.TP
.BR "\-s" , "\-\-secure"
On systems which have
.I /dev/random
support, use
.I /dev/random
to generate passwords rather than
.IR /dev/urandom .
This is more secure, but may be slower, as the process will block
rather than degrade to a PRNG if true random numbers are temporarily
unavailable.  Using
.I "\-s"
on a system without
.I /dev/random
support results in an error message.
.TP
.BR "\-c" , "\-\-c"
For octal numbers, preceed with
.I 0;
for hexadecimal numbers, preceed with
.I 0x;
for decimal numbers, strip leading zeros; for all others, enclose in
double quotes and \\-escape quotes and backslashes if present in the
output.  This will ensure that the output is always a valid C language
constant.  The
.I length
parameter on the command line is always number of significant digits,
not the length of the output.
.SS AUTHOR
H. Peter Anvin <hpa@zytor.com>