No sudo echo

This commit is contained in:
Bob Mottram 2015-08-09 09:59:28 +01:00
parent 82a647779c
commit 46b2895a31
1 changed files with 9 additions and 3 deletions

View File

@ -59,15 +59,21 @@ 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 echo " HostKeyAlgorithms $SSH_HOST_KEY_ALGORITHMS" >> /etc/ssh/ssh_config
sudo cp /etc/ssh/ssh_config ~/
echo " HostKeyAlgorithms $SSH_HOST_KEY_ALGORITHMS" >> ~/ssh_config
sudo mv ~/ssh_config /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 echo " Ciphers $SSH_CIPHERS" >> /etc/ssh/ssh_config
sudo cp /etc/ssh/ssh_config ~/
echo " Ciphers $SSH_CIPHERS" >> ~/ssh_config
sudo mv ~/ssh_config /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 echo " MACs $SSH_MACS" >> /etc/ssh/ssh_config
sudo cp /etc/ssh/ssh_config ~/
echo " MACs $SSH_MACS" >> ~/ssh_config
sudo mv ~/ssh_config /etc/ssh/ssh_config
fi
# Create ssh keys