bashrc & zshrc: add ssh-regen-host-keys function

Closes #37
This commit is contained in:
Mikaela Suomalainen 2014-07-17 16:05:42 +03:00
parent 0b84baae26
commit 78c6507918
2 changed files with 23 additions and 3 deletions

10
bashrc
View File

@ -755,6 +755,16 @@ fix-autostart() {
chmod -R 755 ~/.config/autostart
}
# This function removes and regenerates ssh host keys.
ssh-regen-host-keys () {
rm /etc/ssh/ssh_host_*
ssh-keygen -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t ecdsa -N "" -f /etc/ssh/ssh_host_ecdsa_key
ssh-keygen -t ed25519 -N "" -f /etc/ssh/ssh_host_ed25519_key
}
# .custom
if [ -f ~/.custom ]; then
source ~/.custom

16
zshrc
View File

@ -728,19 +728,29 @@ fix-autostart() {
chmod -R 755 ~/.config/autostart
}
# This function removes and regenerates ssh host keys.
ssh-regen-host-keys () {
rm /etc/ssh/ssh_host_*
ssh-keygen -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t ecdsa -N "" -f /etc/ssh/ssh_host_ecdsa_key
ssh-keygen -t ed25519 -N "" -f /etc/ssh/ssh_host_ed25519_key
}
# Source files for miscannellious modifications.
# .custom
if [ -f ~/.custom ]; then
source ~/.custom
fi
fi
# .zsh_custom
if [ -f ~/.zsh_custom ]; then
source ~/.zsh_custom
fi
fi
# Warnings
if [ -f ~/.warnings ]; then
source ~/.warnings
fi
fi