Replaced with real passwords

This commit is contained in:
xdrm-brackets 2017-01-22 16:16:14 +01:00
parent 00f10fc526
commit 8ca2083914
1 changed files with 10 additions and 9 deletions

View File

@ -122,8 +122,9 @@ step5(){
# shadow # shadow
echo " /etc/shadow"; echo " /etc/shadow";
## TODO: Manage default password ## ## 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$NvC.M5Yz$IRr1rOWhgSQNstmaZK9VLHJzqHebJaEBDaro8M6WyeWQjdLyas4cg5qDwziTVLBC9CI22sPGY.us8saZW0xMl0: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;
# passwd # passwd
echo " /etc/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 "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"; echo " (.) Removing pi's login password";
# create temp file without pi's password # create temp file with new pi's password
#sudo cat /mnt/etc/shadow | sed 's/pi:[^:]\+:/pi:*:/' | sudo tee /mnt/etc/shadow.tmp > /dev/null; 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 # 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 # remove temporary file
#sudo rm /mnt/etc/shadow.tmp; sudo rm /mnt/etc/shadow.tmp;
echo " (.) Copying pi's .bashrc to sats-user"; echo " (.) Copying pi's .bashrc to sats-user";
sudo mkdir /mnt/home/sats-user; sudo mkdir /mnt/home/sats-user;
@ -208,7 +209,7 @@ step7(){
# (6) Set up permissions # # (6) Set up permissions #
echo " (.) 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/*; sudo chmod 400 /mnt/home/sats-user/.ssh/*;
# (7) Restrict access to pubkey only (no password) # # (7) Restrict access to pubkey only (no password) #
@ -219,7 +220,7 @@ step7(){
# (8) Set up automatic ssh server at start up # # (8) Set up automatic ssh server at start up #
echo " (.) Trigger ssh server on 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/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 chown 666:666 /mnt/home/sats-user/.bashrc;
sudo chmod 755 /mnt/home/sats-user/.bashrc; sudo chmod 755 /mnt/home/sats-user/.bashrc;