This commit is contained in:
rootzoll 2022-01-27 23:30:10 +01:00
parent 801f5fffd7
commit bf551ec8e7

View File

@ -150,7 +150,7 @@ if [ "$1" = "restore" ]; then
if [ $(sudo ls ${DEFAULT_BASEDIR}/sshd/ssh_host_rsa_key 2>/dev/null | grep -c "ssh_host_rsa_key") -gt 0 ]; then
echo "# restore sshd host keys from: $DEFAULT_BASEDIR/sshd"
sudo rm -rf /etc/ssh/*
sudo cp -a $DEFAULT_BASEDIR/sshd/* /etc/ssh/
sudo cp -ra $DEFAULT_BASEDIR/sshd/* /etc/ssh/
sudo chown -R root:root /etc/ssh
sudo dpkg-reconfigure openssh-server
sudo systemctl restart sshd
@ -165,7 +165,7 @@ if [ "$1" = "restore" ]; then
echo "# restore root use keys from: $DEFAULT_BASEDIR/ssh-root"
sudo rm -rf /root/.ssh
sudo mkdir /root/.ssh
sudo cp -a $DEFAULT_BASEDIR/ssh-root/* /root/.ssh
sudo cp -ra $DEFAULT_BASEDIR/ssh-root/* /root/.ssh
sudo chown -R root:root /root/.ssh
echo "# OK - ssh-root keys restore done"
else