Merge lp:~smoser/cirros/trunk.letsplay2 into lp:cirros

Proposed by Scott Moser
Status: Merged
Merge reported by: Scott Moser
Merged at revision: not available
Proposed branch: lp:~smoser/cirros/trunk.letsplay2
Merge into: lp:cirros
Diff against target: 83 lines (+53/-2)
4 files modified
ChangeLog (+1/-0)
bin/encrypt-pass (+50/-0)
src/etc/issue (+1/-1)
src/etc/shadow (+1/-1)
To merge this branch: bzr merge lp:~smoser/cirros/trunk.letsplay2
Reviewer Review Type Date Requested Status
cirros developers Pending
Review via email: mp+298652@code.launchpad.net

Commit message

set default password to 'letsplay2'

The smiley face was hard or impossible to type in some scenarios.
The new password still pays homage to the Cubs.

To post a comment you must log in.
Revision history for this message
Vincent Legoll (vincent-legoll) wrote :

OK, that's way better than cubswin:)

The "2" may pose some slight problems, but generally the numeric keys can be easier to find, either with the numeric keypad or with shift (for AZERTY mappings)...

I personally would better go to letsplay without the 2, but I don't know about that homage you speak about... :-)

What would be über cool, would be to make it customizable at image build time, by putting it cleartext in a makefile or something like that, and the src/etc/shadow entry is generated on the fly from that...

That actual change is reviewed-by: me...

Thanks

lp:~smoser/cirros/trunk.letsplay2 updated
368. By Scott Moser

bin/encrypt-pass: add tool for converting plaintext to encrypted

Revision history for this message
Scott Moser (smoser) wrote :

Vincent, your suggestion is possible.
I just added bin/encrypt-pass:
$ ./bin/encrypt-pass gocubs
$1$ksrkfrou$zaB4gvHm7cH/o7kfzKope.

we could then modify the targets etc/shadow to have the new pass from that.

Revision history for this message
Scott Moser (smoser) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2016-06-29 14:46:34 +0000
3+++ ChangeLog 2016-07-15 14:10:26 +0000
4@@ -6,6 +6,7 @@
5 - growpart/growroot: resize partition while mounted with newer growpart.
6 default to background resizing of root filesystem.
7 - handle local subnet routes correctly (LP: #1369367)
8+ - set default password to 'letsplay2' (LP: #1454144)
9 0.3.4
10 - Improve tooling for IPv6 and network debugging [Jens Rosenboom]
11 - make 'nc -ll' work again. [Jens Rosenboom]
12
13=== added file 'bin/encrypt-pass'
14--- bin/encrypt-pass 1970-01-01 00:00:00 +0000
15+++ bin/encrypt-pass 2016-07-15 14:10:26 +0000
16@@ -0,0 +1,50 @@
17+#!/bin/sh
18+# vi: ts=4 noexpandtab
19+Usage() {
20+ cat <<EOF
21+Usage: ${0##*/} password [format]
22+
23+convert password to crypt'd password suitable for /etc/shadow
24+
25+ format is one of:
26+ md5 [default]
27+ sha256
28+ sha512
29+EOF
30+}
31+
32+encrypt_pass() {
33+ local pass="$1" fmt="${2:-md5}" fmt_arg=""
34+ case "$fmt" in
35+ md5) fmt_arg='$1$';;
36+ sha256) fmt_arg='$5$';;
37+ sha512) fmt_arg='$6$';;
38+ \$*\$) fmt_arg="$fmt";;
39+ esac
40+ enc=$(echo "$pass" |
41+ perl -e '
42+ $p=<STDIN>; chomp($p);
43+ $salt = join "", map { (q(a)..q(z))[rand(26)] } 1 .. 8;
44+ if (${ARGV[0]}) { $salt = "${ARGV[0]}$salt\$"; }
45+ print crypt($p, "$salt") . "\n";' "$fmt_arg") || return
46+ [ -n "${enc}" ] && [ "${enc#${fmt_arg}}" != "${enc}" ] &&
47+ _RET="$enc"
48+}
49+error() { echo "$@" 1>&2; }
50+fail() { [ $# -eq 0 ] || error "$@"; exit 1; }
51+
52+[ "$1" = "--help" -o "$1" = "-h" ] && { Usage; exit 0; }
53+if ! [ $# -eq 1 -o $# -eq 2 ]; then
54+ Usage 1>&2
55+ error "got $# args, expected 1 or 2"
56+ exit 1
57+fi
58+
59+password="$1"
60+fmt=${2:-md5}
61+if [ "$1" = "-" ]; then
62+ read password || fail "failed to read password from stdin"
63+fi
64+
65+encrypt_pass "$password" "$fmt" || fail "failed to encrypt password in '$fmt'"
66+echo "$_RET"
67
68=== modified file 'src/etc/issue'
69--- src/etc/issue 2011-10-14 14:50:14 +0000
70+++ src/etc/issue 2016-07-15 14:10:26 +0000
71@@ -1,1 +1,1 @@
72-login as 'cirros' user. default password: 'cubswin:)'. use 'sudo' for root.
73+login as 'cirros' user. default password: 'letsplay2'. use 'sudo' for root.
74
75=== modified file 'src/etc/shadow'
76--- src/etc/shadow 2011-10-14 14:49:55 +0000
77+++ src/etc/shadow 2016-07-15 14:10:26 +0000
78@@ -1,4 +1,4 @@
79-root:!$1$LJwQnqlv$DK6oKqcTq9Rf2ClC.kMa3/:10933:0:99999:7:::
80+root:!$1$ssisyfpf$YqvuJLfrrW6Cg/l53Pi1n1:10933:0:99999:7:::
81 bin:*:10933:0:99999:7:::
82 daemon:*:10933:0:99999:7:::
83 adm:*:10933:0:99999:7:::

Subscribers

People subscribed via source and target branches