Fix updating of client ssh cyphers

This commit is contained in:
Bob Mottram 2015-08-09 10:06:29 +01:00
parent 46b2895a31
commit 40456fd5a8
1 changed files with 9 additions and 3 deletions

View File

@ -59,21 +59,27 @@ function configure_ssh_client {
sudo sed -i "s/# Ciphers.*/ Ciphers $SSH_CIPHERS/g" /etc/ssh/ssh_config
sudo sed -i "s/# MACs.*/ MACs $SSH_MACS/g" /etc/ssh/ssh_config
if ! grep -q "HostKeyAlgorithms" /etc/ssh/ssh_config; then
sudo cp /etc/ssh/ssh_config ~/
sudo cp /etc/ssh/ssh_config ~/ssh_config
sudo chown $CURR_USER:$CURR_USER ~/ssh_config
echo " HostKeyAlgorithms $SSH_HOST_KEY_ALGORITHMS" >> ~/ssh_config
sudo mv ~/ssh_config /etc/ssh/ssh_config
sudo chown root:root /etc/ssh/ssh_config
fi
sudo sed -i "s/Ciphers.*/Ciphers $SSH_CIPHERS/g" /etc/ssh/ssh_config
if ! grep -q "Ciphers " /etc/ssh/ssh_config; then
sudo cp /etc/ssh/ssh_config ~/
sudo cp /etc/ssh/ssh_config ~/ssh_config
sudo chown $CURR_USER:$CURR_USER ~/ssh_config
echo " Ciphers $SSH_CIPHERS" >> ~/ssh_config
sudo mv ~/ssh_config /etc/ssh/ssh_config
sudo chown root:root /etc/ssh/ssh_config
fi
sudo sed -i "s/MACs.*/MACs $SSH_MACS/g" /etc/ssh/ssh_config
if ! grep -q "MACs " /etc/ssh/ssh_config; then
sudo cp /etc/ssh/ssh_config ~/
sudo cp /etc/ssh/ssh_config ~/ssh_config
sudo chown $CURR_USER:$CURR_USER ~/ssh_config
echo " MACs $SSH_MACS" >> ~/ssh_config
sudo mv ~/ssh_config /etc/ssh/ssh_config
sudo chown root:root /etc/ssh/ssh_config
fi
# Create ssh keys