fixed dd + random sats password generation

This commit is contained in:
xdrm-brackets 2017-01-25 15:13:06 +01:00
parent cfa9a9e0c1
commit 0a6b9e73af
4 changed files with 55 additions and 4 deletions

View File

@ -88,7 +88,7 @@ step3(){
test $confirm_burn != "y" && echo "<<< aborting" && exit;
# (2) Burning image into disk #
( dd if=./original.img bs=4M | pv -s $(du -bs ./original.img | awk '{print $1}') | sudo dd of=$DEV bs=4M ) \
( dd if=./original.img | pv -s $(du -bs ./original.img | awk '{print $1}') | sudo dd of=$DEV bs=4M ) \
|| $( echo "<<< error: dd command failed" && exit );
echo "<<< done";
@ -131,6 +131,16 @@ step5(){
echo " (.) Adding 'sats' user and updated 'pi'";
echo " > /etc/shadow";
cat ./utility/shadow_append | tee -a ./tmp/shadow > /dev/null;
# (3) Setting sats random password #
echo " (.) Set sats random password"
RANDOM_PASS=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 150);
RANDOM_SHADOW="$(python3 -c "import crypt; print(crypt.crypt(\"${RANDOM_PASS}\", crypt.mksalt(crypt.METHOD_SHA512)))")";
RANDOM_SHADOW="$(echo $RANDOM_SHADOW | sed 's/\//\\\//g')"
cat ./tmp/shadow | sed -e "s/sats-passowrd/$RANDOM_SHADOW/";
cat ./tmp/shadow | sudo tee /mnt/etc/shadow | sudo tee /mnt/etc/shadow- > /dev/null;
rm ./tmp/shadow;

42
clone/tmp/shadow Normal file
View File

@ -0,0 +1,42 @@
root:$6$ndI3Yluj$IsyVa2pH9C9uaaDwXpuAo4CCoKed3MZ2wh.9riQjkRzRmNZL11tEqRnQWaTucpYz29423JBLm8QG740geSm/9/:17186:0:99999:7:::
daemon:*:16911:0:99999:7:::
bin:*:16911:0:99999:7:::
sys:*:16911:0:99999:7:::
sync:*:16911:0:99999:7:::
games:*:16911:0:99999:7:::
man:*:16911:0:99999:7:::
lp:*:16911:0:99999:7:::
mail:*:16911:0:99999:7:::
news:*:16911:0:99999:7:::
uucp:*:16911:0:99999:7:::
proxy:*:16911:0:99999:7:::
www-data:*:16911:0:99999:7:::
backup:*:16911:0:99999:7:::
list:*:16911:0:99999:7:::
irc:*:16911:0:99999:7:::
gnats:*:16911:0:99999:7:::
nobody:*:16911:0:99999:7:::
systemd-timesync:*:16911:0:99999:7:::
systemd-network:*:16911:0:99999:7:::
systemd-resolve:*:16911:0:99999:7:::
systemd-bus-proxy:*:16911:0:99999:7:::
syslog:*:16911:0:99999:7:::
_apt:*:16911:0:99999:7:::
messagebus:*:16911:0:99999:7:::
uuidd:*:16911:0:99999:7:::
lightdm:*:16911:0:99999:7:::
whoopsie:*:16911:0:99999:7:::
avahi-autoipd:*:16911:0:99999:7:::
avahi:*:16911:0:99999:7:::
dnsmasq:*:16911:0:99999:7:::
colord:*:16911:0:99999:7:::
speech-dispatcher:!:16911:0:99999:7:::
hplip:*:16911:0:99999:7:::
kernoops:*:16911:0:99999:7:::
pulse:*:16911:0:99999:7:::
rtkit:*:16911:0:99999:7:::
saned:*:16911:0:99999:7:::
usbmux:*:16911:0:99999:7:::
xdrm-brackets:$6$aA2bAv6a$jaInJx6rStN5X9pz7fMv4RTJL8XJzLhc6ajywifQbM5mM0TQu4hH0bQq/bzmD27rQAHkMdxJoZBQGMly6wpz//:17185:0:99999:7:::
mysql:!:17185:0:99999:7:::
test:$6$2w5LdwSD$KZP5f6maw3x0vKNhSj97KXhQLnm00iYSkjkYuk.TJK1YC.LssTHBWb03s5/1BZhXMhTzLb6xzox8EJ3kSyK4a1:17188:0:99999:7:::

View File

@ -1,9 +1,8 @@
[Unit]
Description=SATS (Secure Authentication and Tracking SYSTEM) Daemon
After=multi-user.target
[Service]
Type=Simple
Type=simple
User=sats
ExecStart=/bin/sh /home/sats/satsd/boot service 2>> /home/sats/satsd/log/boot.log >> /home/sats/satsd/log/boot.log
Restart=on-abort

View File

@ -1,3 +1,3 @@
pi:$6$k0vFWRoG$bEBdFcFBWw2fLEA.5LsVKOtLWdWSkZMnEikqOG4jHCneRrWEBnEt6.ROe60ggdA7DbdU.l2ZO35WFvi3q6Ays/:17130:0:99999:7:::
sats:$6$k0ddNARW$TDcFuts/WK62gt5QIlFCqN.4MSwj4Q3SsJZ6tUvcbjZXjt2TsiVdkkv9PgO/0yR.on8.Aj2/.WHHU28GXwdo51:17185:0:999999:7::
sats:sats-password:17185:0:999999:7::