|
3 | 3 | basedir=/home/afido
|
4 | 4 |
|
5 | 5 | # aldonu servilo-ŝlosilon por github.com
|
6 |
| -touch ${basedir}/.ssh/known_hosts |
7 |
| -ssh-keygen -f ${basedir}/.ssh/known_hosts -R "github.com" |
8 | 6 |
|
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 |
12 | 10 |
|
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) |
16 | 14 |
|
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 |
26 | 20 |
|
| 21 | +if [ -f "/run/secrets/voko-afido.ssh_key.pub" ]; then |
| 22 | + cat /run/secrets/voko-afido.ssh_key.pub > ${basedir}/.ssh/authorized_keys |
27 | 23 | fi
|
28 | 24 |
|
29 | 25 | chown -R afido:users ${basedir}/.ssh
|
|
0 commit comments