summaryrefslogtreecommitdiffstats
path: root/ranpwd.1
blob: 98fb63f855b6abe2caf9fab3148f9e04a3e05646 (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
\fB\-\-ascii\fR
Allow any printable ASCII character except space.  This is the default.
.TP
\fB\-a\fR, \fB\-\-alphanum\fR
Generate mixed-case alphanumeric passwords.
.TP
\fB\-l\fR, \fB\-\-alphanum \-\-lower\fR
Generate lower-case alphanumeric passwords.
.TP
\fB\-u\fR, \fB\-\-alphanum \-\-upper\fR
Generate upper-case alphanumberic passwords.
.TP
\fB\-A\fR, \fB\-\-alpha\fR
Generate mixed-case alphabetic passwords.
.TP
\fB\-L\fR, \fB\-\-alpha \-\-lower\fR
Generate lower-case alphabetic passwords.
.TP
\fB\-U\fR, \fB\-\-alpha \-\-upper\fR
Generate upper-case alphabetic passwords.
.TP
\fB\-x\fR, \fB\-\-hexadecimal \-\-lower\fR
Generate lower-case hexadecimal numbers.
.TP
\fB\-X\fR, \fB\-\-hexadecimal \-\-upper\fR
Generate upper-case hexadecimal numbers.
.TP
\fB\-d\fR, \fB\-\-decimal\fR
Generate decimal numbers.
.TP
\fB\-o\fR, \fB\-\-octal\fR
Generate octal numbers.
.TP
\fB\-b\fR, \fB\-\-binary\fR
Generate a bit string (for Bynar sabotage teams.)
.TP
\fB\-i\fR, \fB\-\-ip\fR
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\fR, \fB\-\-mac-address\fR
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
\fB\-M\fR, \fB\-\-mac-address \-\-upper\fR
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
\fB\-g\fR, \fB\-\-uuid\fR, \fB\-\-guid\fR
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\fR, \fB\-\-uuid \-\-upper\fR, \fB\-\-guid \-\-upper\fR
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\fR, \fB\-\-secure\fR
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\fR, \fB\-\-c\fR
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>