Fix script errors
This commit is contained in:
@@ -11,10 +11,14 @@ fi
|
|||||||
##Generate keys
|
##Generate keys
|
||||||
mkdir /.SSH/automated/.temp
|
mkdir /.SSH/automated/.temp
|
||||||
ssh-keygen -f /.SSH/automated/.temp/id_ed25519 -N "" &&
|
ssh-keygen -f /.SSH/automated/.temp/id_ed25519 -N "" &&
|
||||||
|
if [ -f rm /.SSH/automated/priv/servers/id_ed25519 ]; then
|
||||||
rm /.SSH/automated/priv/servers/id_ed25519
|
rm /.SSH/automated/priv/servers/id_ed25519
|
||||||
|
fi
|
||||||
|
if [ -f /.SSH/automated/pub/servers/id_ed25519.pub ]; then
|
||||||
rm /.SSH/automated/pub/servers/id_ed25519.pub
|
rm /.SSH/automated/pub/servers/id_ed25519.pub
|
||||||
/.SSH/automated/.temp/id_ed25519 > /.SSH/automated/priv/servers/
|
fi
|
||||||
/.SSH/automated/.temp/id_ed25519.pub > /.SSH/automated/pub/servers/
|
cat /.SSH/automated/.temp/id_ed25519 > /.SSH/automated/priv/servers/
|
||||||
|
cat /.SSH/automated/.temp/id_ed25519.pub > /.SSH/automated/pub/servers/
|
||||||
sha256sum /.SSH/automated/.temp/id_ed25519 | awk '{print $1}' > /home/$USER/sshprov/priv
|
sha256sum /.SSH/automated/.temp/id_ed25519 | awk '{print $1}' > /home/$USER/sshprov/priv
|
||||||
sha256sum /.SSH/automated/.temp/id_ed25519.pub | awk '{print $1}' > /home/$USER/sshprov/pub
|
sha256sum /.SSH/automated/.temp/id_ed25519.pub | awk '{print $1}' > /home/$USER/sshprov/pub
|
||||||
sleep 2
|
sleep 2
|
||||||
@@ -25,14 +29,14 @@ rm /home/$USER/.ssh/known_hosts
|
|||||||
rm /root/.ssh/known_hosts
|
rm /root/.ssh/known_hosts
|
||||||
rm /root/.ssh/id_ed25519
|
rm /root/.ssh/id_ed25519
|
||||||
rm /root/.ssh/authorized_keys
|
rm /root/.ssh/authorized_keys
|
||||||
/.SSH/automated/priv/servers/id_ed25519 > /root/.ssh/id_ed25519
|
cat /.SSH/automated/priv/servers/id_ed25519 > /root/.ssh/id_ed25519
|
||||||
/.SSH/automated/pub/servers/id_ed25519.pub > /root/.ssh/authorized_keys &&
|
cat /.SSH/automated/pub/servers/id_ed25519.pub > /root/.ssh/authorized_keys &&
|
||||||
chmod 700 /root/.ssh/id_ed25519
|
chmod 700 /root/.ssh/id_ed25519
|
||||||
chmod 644 /root/.ssh/authorized_keys
|
chmod 644 /root/.ssh/authorized_keys
|
||||||
rm /home/$USER/.ssh/id_ed25519
|
rm /home/$USER/.ssh/id_ed25519
|
||||||
rm /home/$USER/.ssh/authorized_keys
|
rm /home/$USER/.ssh/authorized_keys
|
||||||
/.SSH/automated/priv/servers/id_ed25519 > /home/$USER/.ssh/id_ed25519
|
cat /.SSH/automated/priv/servers/id_ed25519 > /home/$USER/.ssh/id_ed25519
|
||||||
/.SSH/automated/pub/servers/id_ed25519.pub > /home/$USER/.ssh/authorized_keys &&
|
cat /.SSH/automated/pub/servers/id_ed25519.pub > /home/$USER/.ssh/authorized_keys &&
|
||||||
chmod 700 /home/$USER/.ssh
|
chmod 700 /home/$USER/.ssh
|
||||||
chmod 600 /home/$USER/.ssh/id_ed25519
|
chmod 600 /home/$USER/.ssh/id_ed25519
|
||||||
chmod 600 /home/$USER/.ssh/authorized_keys
|
chmod 600 /home/$USER/.ssh/authorized_keys
|
||||||
|
|||||||
Reference in New Issue
Block a user