From 36fbe057d2235cbc12c3e7e85d88486d02be6c12 Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Tue, 16 Aug 2022 13:14:56 -0400 Subject: add ssh module --- modules/10-ssh/install.sh | 34 +++++++++++++++++++++++++++++++ modules/10-ssh/ssh/config | Bin 0 -> 221 bytes modules/10-ssh/ssh/id_ed25519 | Bin 0 -> 466 bytes modules/10-ssh/ssh/id_ed25519.pub | Bin 0 -> 115 bytes modules/10-ssh/ssh/id_ed25519_legacy | Bin 0 -> 466 bytes modules/10-ssh/ssh/id_ed25519_legacy.pub | Bin 0 -> 115 bytes modules/10-ssh/ssh/id_katy | Bin 0 -> 2624 bytes modules/10-ssh/ssh/id_katy.pub | Bin 0 -> 587 bytes modules/10-ssh/ssh/id_rsa | Bin 0 -> 2657 bytes modules/10-ssh/ssh/id_rsa.pub | Bin 0 -> 587 bytes modules/10-ssh/ssh/id_rsa_legacy | Bin 0 -> 2657 bytes modules/10-ssh/ssh/id_rsa_legacy.pub | Bin 0 -> 587 bytes modules/10-ssh/ssh/id_rsync | Bin 0 -> 421 bytes modules/10-ssh/ssh/id_rsync.pub | Bin 0 -> 115 bytes modules/10-ssh/ssh/known_hosts | Bin 0 -> 8563 bytes modules/10-ssh/ssh/known_hosts.old | Bin 0 -> 8391 bytes 16 files changed, 34 insertions(+) create mode 100644 modules/10-ssh/install.sh create mode 100644 modules/10-ssh/ssh/config create mode 100644 modules/10-ssh/ssh/id_ed25519 create mode 100644 modules/10-ssh/ssh/id_ed25519.pub create mode 100644 modules/10-ssh/ssh/id_ed25519_legacy create mode 100644 modules/10-ssh/ssh/id_ed25519_legacy.pub create mode 100644 modules/10-ssh/ssh/id_katy create mode 100644 modules/10-ssh/ssh/id_katy.pub create mode 100644 modules/10-ssh/ssh/id_rsa create mode 100644 modules/10-ssh/ssh/id_rsa.pub create mode 100644 modules/10-ssh/ssh/id_rsa_legacy create mode 100644 modules/10-ssh/ssh/id_rsa_legacy.pub create mode 100644 modules/10-ssh/ssh/id_rsync create mode 100644 modules/10-ssh/ssh/id_rsync.pub create mode 100644 modules/10-ssh/ssh/known_hosts create mode 100644 modules/10-ssh/ssh/known_hosts.old (limited to 'modules/10-ssh') diff --git a/modules/10-ssh/install.sh b/modules/10-ssh/install.sh new file mode 100644 index 0000000..8fb3145 --- /dev/null +++ b/modules/10-ssh/install.sh @@ -0,0 +1,34 @@ +_script="$(realpath ${BASH_SOURCE[0]})" +_scriptname="$(basename $_script)" +_scriptdir="$(dirname $_script)" +_modulename="$(basename $_scriptdir)" +DOT_MODULE_NAME="ssh" + +function preinstall() { + if ! [[ -x "$(command -v ssh)" ]]; then + PACKAGES+=("openssh") + fi + if ! [[ -x "$(command -v git-crypt)" ]]; then + PACKAGES+=("git-crypt") + fi +} + +function install() { + git-crypt unlock + + if [[ "$?" -ne "0" ]]; then + log error "error decrypting ssh files, bailing before we break anthing" + return + fi + + # backup old file if it exists and we haven't backed it up before + if [[ -d "$HOME/.ssh" ]] && ! [[ -d "$HOME/.ssh.bak" ]] && ! [[ -f "$_scriptdir/.firstrun" ]]; then + log verbose "making backup" + cp -r "$HOME/.ssh" "$HOME/.ssh.bak" + touch "$_scriptdir/.firstrun" + fi + + log info "linking ~/.ssh" + rm -rf "$HOME/.ssh" + ln -sf "$_scriptdir/ssh" "$HOME/.ssh" +} diff --git a/modules/10-ssh/ssh/config b/modules/10-ssh/ssh/config new file mode 100644 index 0000000..fc90c1b Binary files /dev/null and b/modules/10-ssh/ssh/config differ diff --git a/modules/10-ssh/ssh/id_ed25519 b/modules/10-ssh/ssh/id_ed25519 new file mode 100644 index 0000000..fa5c8ee Binary files /dev/null and b/modules/10-ssh/ssh/id_ed25519 differ diff --git a/modules/10-ssh/ssh/id_ed25519.pub b/modules/10-ssh/ssh/id_ed25519.pub new file mode 100644 index 0000000..663d9c2 Binary files /dev/null and b/modules/10-ssh/ssh/id_ed25519.pub differ diff --git a/modules/10-ssh/ssh/id_ed25519_legacy b/modules/10-ssh/ssh/id_ed25519_legacy new file mode 100644 index 0000000..fa5c8ee Binary files /dev/null and b/modules/10-ssh/ssh/id_ed25519_legacy differ diff --git a/modules/10-ssh/ssh/id_ed25519_legacy.pub b/modules/10-ssh/ssh/id_ed25519_legacy.pub new file mode 100644 index 0000000..663d9c2 Binary files /dev/null and b/modules/10-ssh/ssh/id_ed25519_legacy.pub differ diff --git a/modules/10-ssh/ssh/id_katy b/modules/10-ssh/ssh/id_katy new file mode 100644 index 0000000..9b99dc0 Binary files /dev/null and b/modules/10-ssh/ssh/id_katy differ diff --git a/modules/10-ssh/ssh/id_katy.pub b/modules/10-ssh/ssh/id_katy.pub new file mode 100644 index 0000000..b118bcf Binary files /dev/null and b/modules/10-ssh/ssh/id_katy.pub differ diff --git a/modules/10-ssh/ssh/id_rsa b/modules/10-ssh/ssh/id_rsa new file mode 100644 index 0000000..219071e Binary files /dev/null and b/modules/10-ssh/ssh/id_rsa differ diff --git a/modules/10-ssh/ssh/id_rsa.pub b/modules/10-ssh/ssh/id_rsa.pub new file mode 100644 index 0000000..cae0988 Binary files /dev/null and b/modules/10-ssh/ssh/id_rsa.pub differ diff --git a/modules/10-ssh/ssh/id_rsa_legacy b/modules/10-ssh/ssh/id_rsa_legacy new file mode 100644 index 0000000..219071e Binary files /dev/null and b/modules/10-ssh/ssh/id_rsa_legacy differ diff --git a/modules/10-ssh/ssh/id_rsa_legacy.pub b/modules/10-ssh/ssh/id_rsa_legacy.pub new file mode 100644 index 0000000..cae0988 Binary files /dev/null and b/modules/10-ssh/ssh/id_rsa_legacy.pub differ diff --git a/modules/10-ssh/ssh/id_rsync b/modules/10-ssh/ssh/id_rsync new file mode 100644 index 0000000..3e6b73d Binary files /dev/null and b/modules/10-ssh/ssh/id_rsync differ diff --git a/modules/10-ssh/ssh/id_rsync.pub b/modules/10-ssh/ssh/id_rsync.pub new file mode 100644 index 0000000..066d6b8 Binary files /dev/null and b/modules/10-ssh/ssh/id_rsync.pub differ diff --git a/modules/10-ssh/ssh/known_hosts b/modules/10-ssh/ssh/known_hosts new file mode 100644 index 0000000..be2db8a Binary files /dev/null and b/modules/10-ssh/ssh/known_hosts differ diff --git a/modules/10-ssh/ssh/known_hosts.old b/modules/10-ssh/ssh/known_hosts.old new file mode 100644 index 0000000..b34f3ff Binary files /dev/null and b/modules/10-ssh/ssh/known_hosts.old differ -- cgit v1.2.3