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

Proposed by Scott Moser on 2016-06-29
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 2016-06-29 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.
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 on 2016-07-15
368. By Scott Moser on 2016-07-15

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

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.

Preview Diff

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

Subscribers

People subscribed via source and target branches