Last active
May 17, 2024 07:18
-
-
Save zecar/f04b1abd10c832120e3ff1b01b066e56 to your computer and use it in GitHub Desktop.
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 characters
----- CREATE KEY -------- | |
ssh-keygen -t rsa | |
ssh user@host mkdir -p .ssh // in case it's not there | |
cat .ssh/id_rsa.pub | ssh user@host 'cat >> .ssh/authorized_keys' | |
------ IN ~/sl.sh ---------- | |
#!/bin/zsh | |
ALIAS=$1 | |
declare -A ALIASES | |
ALIASES[vps]="ssh user@host" | |
if ! [[ $ALIASES[$ALIAS] ]]; then | |
echo "no alias found" | |
exit 1 | |
fi | |
eval ${ALIASES[${ALIAS}]} | |
---------IN ~/.zshrc--------- | |
alias sl="zsh ~/sl.sh" | |
--------- AFTER ALL THIS -------- | |
source ~/.zshrc | |
after that you just type | |
sl myVPS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ALIASES[vps]="ssh [email protected]"
ALIASES[ep]="ssh [email protected]"