This commit is contained in:
24
scripts/setup_ssh.sh
Executable file
24
scripts/setup_ssh.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ ! -d ~/.ssh ]; then
|
||||
mkdir -p ~/.ssh
|
||||
chmod 700 ~/.ssh
|
||||
fi
|
||||
|
||||
if [ -n "$SSH_KEY" ]; then
|
||||
SSH_KEY_ID="$HOME/.ssh/id_ed25519"
|
||||
echo $SSH_KEY | base64 -d > $SSH_KEY_ID
|
||||
|
||||
chmod 600 $SSH_KEY_ID
|
||||
|
||||
cat >$HOME/.ssh/config <<EOL
|
||||
Host git.front.kjuulh.io
|
||||
IdentityFile ${SSH_KEY_ID}
|
||||
IdentitiesOnly yes
|
||||
UserKnownHostsFile=/dev/null
|
||||
StrictHostKeyChecking no
|
||||
EOL
|
||||
|
||||
fi
|
Reference in New Issue
Block a user