SpectreOS-old/ssh-keygen-auto.sh
2018-02-26 02:41:29 +01:00

14 lines
237 B
Bash
Executable file

#!/bin/bash
set -ex
server="$1"
[[ -z "${server}" ]] && echo "Bitte einen SSH-Server eintragen!!!" && exit 1
server=root@${server}
ssh-keygen -b 4096
cat ~/.ssh/id_rsa.pub
ssh-copy-id -i ~/.ssh/id_rsa.pub ${server}
echo "Fertig!!!"