Compare commits
3 Commits
debian
...
LukasLenCP
Author | SHA1 | Date | |
---|---|---|---|
e623d7f21a | |||
8856ba9cf4
|
|||
7326d8f70d |
13
README.md
13
README.md
@ -29,6 +29,19 @@ Der Deamon besteht aus folgenden Dateien.
|
|||||||
* foodoor-ssh-wrapper
|
* foodoor-ssh-wrapper
|
||||||
* foodoor-update-keydb
|
* foodoor-update-keydb
|
||||||
|
|
||||||
|
Zusätzlich sollte für das git-repo eine Config angelegt werden:
|
||||||
|
|
||||||
|
/root/.ssh/config
|
||||||
|
```
|
||||||
|
Host git.chaospott.de
|
||||||
|
User git
|
||||||
|
Port 2222
|
||||||
|
IdentityFile ~/.ssh/id_chaospott
|
||||||
|
```
|
||||||
|
|
||||||
|
Das IdentityFile ist der Deploy-SSH-Key, der im [Repo](https://git.chaospott.de/Chaospott/foodoor-keys) hinterlegt ist.
|
||||||
|
|
||||||
|
|
||||||
##Schüssel
|
##Schüssel
|
||||||
|
|
||||||
###Schlüsselupdate
|
###Schlüsselupdate
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
|
export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
|
||||||
@ -9,7 +9,7 @@ dest=/var/run/foodoor-keys
|
|||||||
if [ ! -e "${dest}/.git/config" ]
|
if [ ! -e "${dest}/.git/config" ]
|
||||||
then
|
then
|
||||||
#echo "Repo does not exist, trying to clone..."
|
#echo "Repo does not exist, trying to clone..."
|
||||||
( cd /var/run && git clone --quiet --single-branch --depth=1 luftschleuse@nordstern.chaospott.de:/home/luftschleuse/foodoor-keys "${dest}" )
|
( cd /var/run && git clone --quiet --single-branch --depth=1 ssh://git.chaospott.de/Chaospott/foodoor-keys.git "${dest}" )
|
||||||
else
|
else
|
||||||
#echo "Repo exists, updating..."
|
#echo "Repo exists, updating..."
|
||||||
( cd "${dest}" && git fetch --quiet && git merge --quiet origin/master master )
|
( cd "${dest}" && git fetch --quiet && git merge --quiet origin/master master )
|
||||||
@ -22,10 +22,13 @@ do
|
|||||||
find "${dest}/keys" -name '*.pub' | sort | \
|
find "${dest}/keys" -name '*.pub' | sort | \
|
||||||
while read keyfile
|
while read keyfile
|
||||||
do
|
do
|
||||||
valid_key=$(ssh-keygen -l -f ${keyfile})
|
ssh-keygen -l -f ${keyfile} &> /dev/null
|
||||||
if [ "$?" -eq "0" ]; then
|
if [ $? -eq 0 ]; then
|
||||||
if [ $(echo "${valid_key}" | cut -d" " -f1) -lt "4096" ]; then
|
key_length=`ssh-keygen -l -f ${keyfile} | cut -d" " -f1`
|
||||||
echo "Size of key ${keyfile} is less than 4096. Not adding it to key database." >&2
|
if ssh-keygen -l -f id_ed25519.pub| cut -d" " -f4 == "(ED25519)"; then
|
||||||
|
key_length += 3840
|
||||||
|
if [ ${key_length} -lt 4096 ]; then
|
||||||
|
echo "Key size of key ${keyfile} not equal to 4096. Not adding it to key database." >&2
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user