clear known_hosts
This commit is contained in:
parent
358fd7d687
commit
6cde243005
1 changed files with 20 additions and 12 deletions
|
@ -1,20 +1,28 @@
|
||||||
|
KEY_ALGORITHM='ed25519'
|
||||||
|
KEY_PATH=".ssh/id_ed25519"
|
||||||
|
KEY_PUBLIC='AAAAC3NzaC1lZDI1NTE5AAAAIPHCNcgHlQoiNTXfnUZYvHz9OZwYsmBCrSSV7a7Zche5'
|
||||||
|
PACKAGES=(
|
||||||
|
'python3'
|
||||||
|
'rsync'
|
||||||
|
'tree'
|
||||||
|
)
|
||||||
|
SERVER="$(basename ${GITHUB_SERVER_URL})"
|
||||||
|
|
||||||
# ssh
|
# ssh
|
||||||
|
|
||||||
mkdir --parents ~/.ssh
|
mkdir '.ssh' \
|
||||||
|
|| exit
|
||||||
|
|
||||||
echo "${CD}" > ~/.ssh/id_ed25519
|
echo "${CD}" > "${KEY_PATH}" \
|
||||||
|
|| exit
|
||||||
unset CD
|
unset CD
|
||||||
chmod 400 ~/.ssh/id_ed25519
|
chmod '400' "${KEY_PATH}" \
|
||||||
|
|| exit
|
||||||
|
|
||||||
echo -n "\
|
echo "${SERVER} ssh-${KEY_ALGORITHM} ${KEY_PUBLIC}" \
|
||||||
|1|BcccCTMLpM9HHSgJmPu/FFOwOv0=|+3BKK02xibpCPxQ9Nghi2GbXLng= \
|
> '.ssh/known_hosts' \
|
||||||
ssh-ed25519 \
|
|| exit
|
||||||
AAAAC3NzaC1lZDI1NTE5AAAAIPHCNcgHlQoiNTXfnUZYvHz9OZwYsmBCrSSV7a7Zche5
|
|
||||||
" > ~/.ssh/known_hosts
|
|
||||||
|
|
||||||
# packages
|
# packages
|
||||||
|
|
||||||
apt-get install --yes \
|
apt-get install --yes "${PACKAGES[@]}"
|
||||||
'python3' \
|
|
||||||
'rsync' \
|
|
||||||
'tree' \
|
|
||||||
|
|
Loading…
Reference in a new issue