denisglotov / boo

Boot scripts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Boot scripts for new host

Build status

#!/bin/bash
BOOT_USER='denis'     # <--- add your username
DUCKDOMAIN='vultrone' # <--- domain for duckdns
DUCKTOKEN='...'       # <--- token for duckdns

sudo apt update
sudo apt install apt-transport-https ca-certificates curl git software-properties-common
echo url="https://www.duckdns.org/update?domains=${DUCKDOMAIN}&token=${DUCKTOKEN}&ip=" | curl -k -o /tmp/boo.log -K -
curl https://raw.githubusercontent.com/denisglotov/boo/master/create-user.sh | bash -s -- "$BOOT_USER" "$(curl https://glotov.org/ssh)"

After the VM is created, run

ssh-keygen -f "/home/denis/.ssh/known_hosts" -R "vultrone.duckdns.org"
ssh vultrone "ssh-keyscan github.com >>~/.ssh/known_hosts && git clone -b dev https://github.com/denisglotov/boo.git && boo/install-root.sh"

Installs

Logs

Log go to /tmp/boo.log.

Ssh agent forwarding

Note that you need to use ssh-agent to make your keys forwarded. I use the following snippet in .bashrc:

if [ ! -S /tmp/ssh_auth_sock ]; then
    echo -e "Starting the ssh-agent: "
    eval `ssh-agent`
    ln -sf "$SSH_AUTH_SOCK" /tmp/ssh_auth_sock
fi
export SSH_AUTH_SOCK=/tmp/ssh_auth_sock
ssh-add -l > /dev/null || ssh-add

And the following in record .ssh/config:

Host vultrone
Hostname vultrone.duckdns.org
User denis
ForwardAgent yes
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes

Ssh keys

[!] Remember to keep your current public keys committed to .ssh/id_rsa.pub. Alternatively, update create-user.sh argument.

About

Boot scripts


Languages

Language:Shell 100.0%