Skip to content

Commit dcc333e

Browse files
committed
(reprovo) plibonigo ssh-agordo
1 parent a46b616 commit dcc333e

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

bin/setup_ssh.sh

+13-17
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,23 @@
33
basedir=/home/afido
44

55
# aldonu servilo-ŝlosilon por github.com
6-
touch ${basedir}/.ssh/known_hosts
7-
ssh-keygen -f ${basedir}/.ssh/known_hosts -R "github.com"
86

9-
if [ -f "/run/secrets/voko-afido.ssh_key.pub" ]; then
10-
11-
cat /run/secrets/voko-afido.ssh_key.pub > ${basedir}/.ssh/authorized_keys
7+
# se unua klonado ankoraŭ kaŭzas problemojn pri la servilo-ŝlosilo, jen du priaj diskutoj:
8+
# https://stackoverflow.com/questions/13363553/git-error-host-key-verification-failed-when-connecting-to-remote-repository
9+
# https://stackoverflow.com/questions/18711794/warning-permanently-added-the-rsa-host-key-for-ip-address
1210

13-
# unua klonado ankoraŭ kaŭzas problemojn pri la servilo-ŝlosilo, jen du priaj diskutoj:
14-
# https://stackoverflow.com/questions/13363553/git-error-host-key-verification-failed-when-connecting-to-remote-repository
15-
# https://stackoverflow.com/questions/18711794/warning-permanently-added-the-rsa-host-key-for-ip-address
11+
if [ ! -s ${basedir}/.ssh/known_hosts ]; then
12+
#touch ${basedir}/.ssh/known_hosts
13+
gh_rsa=$(ssh-keyscan -t rsa github.com)
1614

17-
## momente ni ne bezonas tion, ĉar ni uzas GITHUB_TOKEN anst. DEPLOY-KEY
18-
##if [ ! -s ${basedir}/.ssh/known_hosts ]; then
19-
## gh_rsa=$(ssh-keyscan -t rsa github.com)
20-
##
21-
## gh_fp=$(echo -e "${gh_rsa}" | ssh-keygen -lf -)
22-
## if [[ "${gh_fp}" == *"2048 SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8 github.com (RSA)"* ]]; then
23-
## echo -e "${gh_rsa}" >> ${basedir}/.ssh/known_hosts
24-
## fi
25-
##fi
15+
gh_fp=$(echo -e "${gh_rsa}" | ssh-keygen -lf -)
16+
if [[ "${gh_fp}" == *"3072 SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s github.com (RSA)"* ]]; then
17+
echo -e "${gh_rsa}" >> ${basedir}/.ssh/known_hosts
18+
fi
19+
fi
2620

21+
if [ -f "/run/secrets/voko-afido.ssh_key.pub" ]; then
22+
cat /run/secrets/voko-afido.ssh_key.pub > ${basedir}/.ssh/authorized_keys
2723
fi
2824

2925
chown -R afido:users ${basedir}/.ssh

0 commit comments

Comments
 (0)