From bd7e09df58fe2012813f60d299c33690aaab4eea Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 25 Jun 2020 02:41:37 +0000 Subject: [PATCH] consolidate ssh utils --- ssh-utils/README.md | 35 +++++++++++++++++++ ssh-utils/install.sh | 7 ++++ .../install.sh => ssh-utils/ssh-adduser.sh | 0 .../install.sh => ssh-utils/ssh-pubkey.sh | 0 .../install.sh => ssh-utils/ssh-setpass.sh | 0 5 files changed, 42 insertions(+) create mode 100644 ssh-utils/README.md create mode 100644 ssh-utils/install.sh rename ssh-adduser/install.sh => ssh-utils/ssh-adduser.sh (100%) rename ssh-pubkey/install.sh => ssh-utils/ssh-pubkey.sh (100%) rename ssh-setpass/install.sh => ssh-utils/ssh-setpass.sh (100%) diff --git a/ssh-utils/README.md b/ssh-utils/README.md new file mode 100644 index 0000000..2a0d20c --- /dev/null +++ b/ssh-utils/README.md @@ -0,0 +1,35 @@ +--- +title: SSH Utils +homepage: https://webinstall.dev/ssh-utils +tagline: | + SSH Utils: Because --help takes to long. +description: | + SSH Utils includes shortcut commands for some common tasks, including `ssh-pubkey`, `ssh-setpass`, and `ssh-adduser` +--- + +**ssh-pubkey**: + +`ssh-pubkey` will make sure you have an SSH key, and then print it to the screen +and place it in `~/Downloads`. + +```bash +ssh-pubkey +``` + +```txt +~/Downloads/id_rsa.johndoe.pub: + +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTOhRnzDJNBNBXVCgkxkEaDM4IAp81MtE8fuqeQuFvq5gYLWoZND39N++bUvjMRCveWzZlQNxcLjXHlZA3mGj1b9aMImrvyoq8FJepe+RLEuptJe3md4EtTXo8VJuMXV0lJCcd9ct+eqJ0jH0ww4FDJXWMaFbiVwJBO0IaYevlwcf0QwH12FCARZUSwXfsIeCZNGxOPamIUCXumpQiAjTLGHFIDyWwLDCNPi8GyB3VmqsTNEvO/H8yY4VI7l9hpztE5W6LmGUfTMZrnsELryP5oRlo8W5oVFFS85Lb8bVfn43deGdlLGkwmcJuXzZfostSTHI5Mj7MWezPZyoSqFLl johndoe@MacBook-Air +``` + +**ssh-adduser**: + +Many modern web programs (`npm` and `postgres`, for example) will not function +correctly if run as root. `ssh-adduser` adds user `me` with the same +**`~/.ssh/authorized_keys`** as the `root` user, with a long random password, +and gives `me` `sudo` privileges. + +**ssh-setpass**: + +`ssh-setpass` will ask you for your old passphrase (if any) and then for the new +one to reset it with. diff --git a/ssh-utils/install.sh b/ssh-utils/install.sh new file mode 100644 index 0000000..08b3f8a --- /dev/null +++ b/ssh-utils/install.sh @@ -0,0 +1,7 @@ +{ + rm -f "$HOME/.local/bin/ssh-pubkey" "$HOME/.local/bin/ssh-setpass" "$HOME/.local/bin/ssh-adduser" + webi_download "$WEBI_HOST/packages/ssh-utils/ssh-pubkey.sh" "$HOME/.local/bin/ssh-pubkey" + webi_download "$WEBI_HOST/packages/ssh-utils/ssh-setpass.sh" "$HOME/.local/bin/ssh-setpass" + webi_download "$WEBI_HOST/packages/ssh-utils/ssh-adduser.sh" "$HOME/.local/bin/ssh-adduser" + chmod a+x "$HOME/.local/bin/ssh-"* +} diff --git a/ssh-adduser/install.sh b/ssh-utils/ssh-adduser.sh similarity index 100% rename from ssh-adduser/install.sh rename to ssh-utils/ssh-adduser.sh diff --git a/ssh-pubkey/install.sh b/ssh-utils/ssh-pubkey.sh similarity index 100% rename from ssh-pubkey/install.sh rename to ssh-utils/ssh-pubkey.sh diff --git a/ssh-setpass/install.sh b/ssh-utils/ssh-setpass.sh similarity index 100% rename from ssh-setpass/install.sh rename to ssh-utils/ssh-setpass.sh -- 2.25.1