From 8ca208391429c1d5e7eef6663afa53a29b4e9b65 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 22 Jan 2017 16:16:14 +0100 Subject: [PATCH] Replaced with real passwords --- clone/clone | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/clone/clone b/clone/clone index f99e012..10f2e88 100755 --- a/clone/clone +++ b/clone/clone @@ -122,8 +122,9 @@ step5(){ # shadow echo " /etc/shadow"; ## TODO: Manage default password ## - echo "sats-user:$6$k0vFWRoG$bEBdFcFBWw2fLEA.5LsVKOtLWdWSkZMnEikqOG4jHCneRrWEBnEt6.ROe60ggdA7DbdU.l2ZO35WFvi3q6Ays/:17185:0:999999:7::" | sudo tee -a /mnt/etc/shadow > /dev/null; - echo "sats-user:$6$k0vFWRoG$bEBdFcFBWw2fLEA.5LsVKOtLWdWSkZMnEikqOG4jHCneRrWEBnEt6.ROe60ggdA7DbdU.l2ZO35WFvi3q6Ays/:17185:0:999999:7::" | sudo tee -a /mnt/etc/shadow- > /dev/null; + echo "sats-user:$6$NvC.M5Yz$IRr1rOWhgSQNstmaZK9VLHJzqHebJaEBDaro8M6WyeWQjdLyas4cg5qDwziTVLBC9CI22sPGY.us8saZW0xMl0:17185:0:999999:7::" | sudo tee -a /mnt/etc/shadow > /dev/null; + + echo "sats-user:$6$NvC.M5Yz$IRr1rOWhgSQNstmaZK9VLHJzqHebJaEBDaro8M6WyeWQjdLyas4cg5qDwziTVLBC9CI22sPGY.us8saZW0xMl0:17185:0:999999:7::" | sudo tee -a /mnt/etc/shadow- > /dev/null; # passwd echo " /etc/passwd"; @@ -131,13 +132,13 @@ step5(){ echo "sats-user:x:666:666:sats-user,,,:/home/sats-user:/bin/sh" | sudo tee -a /mnt/etc/passwd- > /dev/null; echo " (.) Removing pi's login password"; - # create temp file without pi's password - #sudo cat /mnt/etc/shadow | sed 's/pi:[^:]\+:/pi:*:/' | sudo tee /mnt/etc/shadow.tmp > /dev/null; + # create temp file with new pi's password + sudo cat /mnt/etc/shadow | sed 's/pi:[^:]\+:/pi:$6$k0vFWRoG$bEBdFcFBWw2fLEA.5LsVKOtLWdWSkZMnEikqOG4jHCneRrWEBnEt6.ROe60ggdA7DbdU.l2ZO35WFvi3q6Ays\/:/' | sudo tee /mnt/etc/shadow.tmp > /dev/null; # write original files - #sudo cat /mnt/etc/shadow.tmp | sudo tee /mnt/etc/shadow > /dev/null; - #sudo cat /mnt/etc/shadow.tmp | sudo tee /mnt/etc/shadow- > /dev/null; + sudo cat /mnt/etc/shadow.tmp | sudo tee /mnt/etc/shadow > /dev/null; + sudo cat /mnt/etc/shadow.tmp | sudo tee /mnt/etc/shadow- > /dev/null; # remove temporary file - #sudo rm /mnt/etc/shadow.tmp; + sudo rm /mnt/etc/shadow.tmp; echo " (.) Copying pi's .bashrc to sats-user"; sudo mkdir /mnt/home/sats-user; @@ -208,7 +209,7 @@ step7(){ # (6) Set up permissions # echo " (.) Set up permissions"; - sudo chown -R 666:666 /mnt/home/sats-user/.ssh/; + sudo chown -R 666:666 /mnt/home/sats-user/; sudo chmod 400 /mnt/home/sats-user/.ssh/*; # (7) Restrict access to pubkey only (no password) # @@ -219,7 +220,7 @@ step7(){ # (8) Set up automatic ssh server at start up # echo " (.) Trigger ssh server on start up" echo "sudo service ssh restart" | sudo tee -a /mnt/home/pi/.bashrc > /dev/null; - echo "sudo service ssh restart" | sudo tee -a /mnt/home/sats-user/.bashrc > /dev/null; + # echo "sudo service ssh restart" | sudo tee -a /mnt/home/sats-user/.bashrc > /dev/null; sudo chown 666:666 /mnt/home/sats-user/.bashrc; sudo chmod 755 /mnt/home/sats-user/.bashrc;