Skip to content

Instantly share code, notes, and snippets.

@Dagimal
Created March 1, 2023 15:14
Show Gist options
  • Select an option

  • Save Dagimal/73b550338c5b60cf55c3866c43ebf9f7 to your computer and use it in GitHub Desktop.

Select an option

Save Dagimal/73b550338c5b60cf55c3866c43ebf9f7 to your computer and use it in GitHub Desktop.
tui ssh manager with fzf
# put this function in your .bashrc or .zshrc and call shf for easy host selection
# requirements:
# - grep
# - fzf
ssf() {
host=$(grep -e "^Host " ~/.ssh/config | awk '{print $2}' | fzf)
echo "SSH session started, connecting to" $host
ssh $host
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment