SpectreOS-old/ssh-keygen-auto.sh

15 lines
237 B
Bash
Raw Permalink Normal View History

2018-02-26 02:41:29 +01:00
#!/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!!!"