Rev | Author | # | Line |
---|---|---|---|
22 | LawrenceDoliveiro | 1 | __Use pwgen(1)__ |
2 | |||
3 | But if that’s too easy for you, here are some more complicated ways of doing it: | ||
4 | |||
19 | JohnMcPherson | 5 | !!PerryLorier's preferred and highly recommended way of choosing passwords |
17 | CraigBox | 6 | |
7 | <pre> | ||
20 | GeorgePollard | 8 | cat /dev/urandom | tr -dc ' -~~' | fold -w 20 | head -n 1 |
17 | CraigBox | 9 | </pre> |
10 | |||
11 | His new password is <tt>_]}e9pgU5-u6_hr~[KF|*</tt>. | ||
12 | |||
13 | !What this does | ||
14 | |||
15 | /dev/urandom is an interface to the kernel's random number generator. If you cat it, you'll get (mostly) random characters. See random(4) for information. | ||
16 | |||
17 | tr(1) is a character translator. -d stands for 'delete characters in this set' and -c stands for 'compliment'. If you check ascii(7) you will see that space and tilde (~) are the outer limits of the 'typeable' ASCII character set. The translator stage will throw away anything lower than space or higher than tilde (all the high-bit ASCII character). | ||
18 | |||
19 | fold(1) wraps lines to a certain width. -w 20 wraps at 20 characters (the default is 80.) Mere mortals will probably want to set this to around 8. | ||
20 | |||
21 | head(1) (the opposite of tail(1)) returns the first lines of an input. head -1 returns only the first line. (use head -n 8 if you want some choices to pick from). | ||
22 | |||
23 | !But but but | ||
24 | |||
25 | If you're a real Unix nerd or are worried that using another process for ''cat(1)'' will only accelerate our path to the heat death of the universe, you can use | ||
26 | |||
27 | <pre> | ||
28 | < /dev/urandom tr -cd '~[:print:]' | head -c 20 ''# every time you waste a cat, god kills a kitten'' | ||
29 | </pre> | ||
30 | |||
31 | !Variants | ||
32 | |||
33 | AristotlePagaltzis prefers slightly less cryptic passwords that are longer instead, which results in | ||
34 | |||
35 | <verbatim> | ||
36 | #!/bin/sh | ||
37 | < /dev/urandom tr -cd '[:alnum:]$!@_:=-' | head -c "${1:-32}" | ||
38 | echo | ||
39 | </verbatim> | ||
40 | |||
41 | !!Other methods | ||
42 | |||
43 | Another popular method is to take the first letter of each word in a line from a song (eg ''I want to ride my bicycle'' -> <tt>iw2rmb</tt>) | ||
44 | |||
45 | Pick a password that sounds like an English word, and people are more likely to remember it. A good Java password generator can be found at http://www.multicians.org/thvv/gpw.html. | ||
46 | |||
21 | DouglasRoyds | 47 | If none of these methods are to your liking, you can always set your password to <tt>gandalf</tt>. This is highly original, and no one is likely to think of it. |
17 | CraigBox | 48 | |
49 | You might find more information on the SecurityNotes page. | ||
50 | |||
51 | ---- | ||
52 | CategorySecurity |
lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 2 times)