code.fastix.org

Dateiansicht:

Datei:Projekte -> Linux:new ssh-hostkeys -> generate_new_ssh_hostkeys.sh
md5:c260b654eeedb5f6524d48e055acbc4f
sha1:94acb47067bce8977ebf2b1f5b1c11f54aa129ab
  1. #!/bin/bash
  2. thisDir=$(pwd);
  3. cd /etc/ssh/
  4. if [ ! -d backup ]; then
  5.         mkdir backup;
  6.         mv -f ssh_host_*_key ./backup/;
  7.         mv -f ssh_host_*_key.pub ./backup/
  8. fi
  9. ssh-keygen -t rsa1    -f ./ssh_host_key         -N "";
  10. ssh-keygen -t dsa     -f ./ssh_host_dsa_key     -N "";
  11. ssh-keygen -t rsa     -f ./ssh_host_rsa_key     -N "";
  12. ssh-keygen -t ed25519 -f ./ssh_host_ed25519_key -N "";
  13. cd $thisDir;