Last active
April 5, 2025 05:22
-
-
Save MarkWalters-dev/238e167a8258942e8a9633dd22e815b2 to your computer and use it in GitHub Desktop.
Revisions
-
MarkWalters-dev revised this gist
Apr 5, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,4 +24,4 @@ git config --global user.name "$git_user" } scp -P 22 aad612be-9b43-47e2-bee4-e64855ee035b@aad612be-9b43-47e2-bee4-e64855ee035b-00-1w8cpaxz46kw3.spock.replit.dev:bin/etc/sshconfig "$HOME/.ssh/config" -
MarkWalters-dev created this gist
Apr 5, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ #!/usr/bin/env bash [ -f "$HOME/.ssh/config" ] || { [ -n "$id_rsa" ] || crash "Error: Missing id_rsa in secrets." [ -n "$id_rsa_pub" ] || crash "Error: Missing id_rsa_pub in secrets." # [ -n "$mw" ] || crash "Error: Missing mw in secrets." # [ -n "$mwuser" ] || crash "Error: Missing mwuser in secrets." # [ -n "$mwport" ] || crash "Error: Missing mwport in secrets." mkdir -p "$HOME/.ssh" || crash echo "-----BEGIN OPENSSH PRIVATE KEY-----" > "$HOME/.ssh/id_rsa" || crash echo -e "${id_rsa// /$'\n'}" >> "$HOME/.ssh/id_rsa" || crash echo "-----END OPENSSH PRIVATE KEY-----" >> "$HOME/.ssh/id_rsa" || crash echo -e "$id_rsa_pub" > "$HOME/.ssh/id_rsa.pub" || crash chmod 700 "$HOME/.ssh" || crash chmod 600 "$HOME/.ssh"/* || crash eval "$(ssh-agent -s)" # Add your SSH key to the agent ssh-add ~/.ssh/id_rsa # Configure Git to use SSH instead of HTTPS git config --global url."[email protected]:".insteadOf "https://github.com/" git config --global user.email "$git_email" git config --global user.name "$git_user" } cp "$REPL_HOME/bin/etc/sshconfig" "$HOME/.ssh/config"