summaryrefslogtreecommitdiffstats
path: root/ranpwd.1
blob: e03755d0b5bf867139eec9f02f6747ea64d0e821 (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
119
120
.\" -----------------------------------------------------------------------
.\"   
.\"   Copyright 1994-2012 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 "26 January 2012" "H. Peter Anvin"
.SH NAME
ranpwd \- generate random passwords
.SH SYNOPSIS
.B ranpwd
[options] [length]
.SH DESCRIPTION
.B ranpwd
generates random passwords.  On Linux or most other newer Unix systems
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
\fB\-\-ascii\fP
Allow any printable ASCII character except space.  This is the default.
.TP
\fB\-a\fP, \fB\-\-alphanum\fP
Generate mixed-case alphanumeric passwords.
.TP
\fB\-l\fP, \fB\-\-alphanum \-\-lower\fP
Generate lower-case alphanumeric passwords.
.TP
\fB\-u\fP, \fB\-\-alphanum \-\-upper\fP
Generate upper-case alphanumberic passwords.
.TP
\fB\-A\fP, \fB\-\-alpha\fP
Generate mixed-case alphabetic passwords.
.TP
\fB\-L\fP, \fB\-\-alpha \-\-lower\fP
Generate lower-case alphabetic passwords.
.TP
\fB\-U\fP, \fB\-\-alpha \-\-upper\fP
Generate upper-case alphabetic passwords.
.TP
\fB\-x\fP, \fB\-\-hexadecimal \-\-lower\fP
Generate lower-case hexadecimal numbers.
.TP
\fB\-X\fP, \fB\-\-hexadecimal \-\-upper\fP
Generate upper-case hexadecimal numbers.
.TP
\fB\-d\fP, \fB\-\-decimal\fP
Generate decimal numbers.
.TP
\fB\-o\fP, \fB\-\-octal\fP
Generate octal numbers.
.TP
\fB\-b\fP, \fB\-\-binary\fP
Generate a bit string (for Bynar sabotage teams).
.TP
\fB\-i\fP, \fB\-\-ip\fP
Generate a random IP suffix (normally used with a
.B 169.254.
prefix).  The first octet cannot be 0 or 255.  Length is given in
octets; the default is two octets.
.TP
\fB\-m\fP, \fB\-\-mac-address\fP
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 (MAC-48).  Specify a length of 8 to
generate an EUI-64.
.TP
\fB\-M\fP, \fB\-\-mac-address \-\-upper\fP
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 (MAC-48).  Specify a length of 8 to
generate an EUI-64.
.TP
\fB\-g\fP, \fB\-\-uuid\fP, \fB\-\-guid\fP
Generate a random Universally Unique Identifier (UUID).  Length is
given in the number of UUIDs to output; the default is one UUID.
.TP
\fB\-G\fP, \fB\-\-uuid \-\-upper\fP, \fB\-\-guid \-\-upper\fP
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
\fB\-s\fP, \fB\-\-secure\fP
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
.B \-\-secure
on a system without
.I /dev/random
support results in an error message.
.TP
\fB\-c\fP, \fB\-\-c\fP
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>