aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/disk-image-builder/nested/patches/02-users
diff options
context:
space:
mode:
authorCarsten Koester <ckoester@cisco.com>2016-05-25 05:58:29 -0400
committerDave Wallace <dwallacelf@gmail.com>2016-06-02 00:18:28 +0000
commit9d378548cc86028c55baf17260d32d0055603b78 (patch)
tree1cc67da7195459abcaca5f12f0f4b74bc399b60e /resources/tools/disk-image-builder/nested/patches/02-users
parent036f36181c177e4c77f22cdbdcb87fb2f94df3bf (diff)
CSIT-111: Add Packer based framework to auto-generate disk images
Change-Id: Ia18ea34a6288aec0f12f176f4cc264d0f215d1fd Signed-off-by: Carsten Koester <ckoester@cisco.com>
Diffstat (limited to 'resources/tools/disk-image-builder/nested/patches/02-users')
-rwxr-xr-xresources/tools/disk-image-builder/nested/patches/02-users37
1 files changed, 37 insertions, 0 deletions
diff --git a/resources/tools/disk-image-builder/nested/patches/02-users b/resources/tools/disk-image-builder/nested/patches/02-users
new file mode 100755
index 0000000000..9b7db0969a
--- /dev/null
+++ b/resources/tools/disk-image-builder/nested/patches/02-users
@@ -0,0 +1,37 @@
+#!/bin/sh -e
+
+patch etc/sudoers <<"_EOF"
+97a98,100
+>
+> csit ALL=(root) NOPASSWD:ALL
+> cisco ALL=(root) NOPASSWD:ALL
+_EOF
+
+patch etc/passwd <<"_EOF"
+10a11,12
+> csit:x:1001:1001:CSIT user:/tmp:/bin/sh
+> cisco:x:1002:1002:Cisco user:/tmp:/bin/sh
+_EOF
+
+patch etc/shadow <<"_EOF"
+1c1
+< root::10933:0:99999:7:::
+---
+> root:5pcUkhKEiBBfw:16892:0:99999:7:::
+10a11,12
+> csit:5pcUkhKEiBBfw:16892:0:99999:7:::
+> cisco:5piAVSAyGsbaI:16892:0:99999:7:::
+_EOF
+
+patch etc/group <<"_EOF"
+27a28,29
+> csit:x:1001:
+> cisco:x:1002:
+_EOF
+
+patch etc/ssh/sshd_config <<"_EOF"
+44c44
+< #PermitRootLogin prohibit-password
+---
+> PermitRootLogin yes
+_EOF