Last active
December 29, 2015 12:59
-
-
Save smichaelsen/7674633 to your computer and use it in GitHub Desktop.
List configured ssh hosts
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
# Lists your configured SSH hosts | |
# | |
# example .ssh/config: | |
# | |
# +----------------------------------+ | |
# |# Intranet | | |
# |Host Bilbo | | |
# | HostName bilbo.intranet | | |
# | User MyUser | | |
# |Host Frodo | | |
# | HostName frodo.intranet | | |
# | User MyUser | | |
# | | | |
# |# Clients | | |
# |Host Client1 | | |
# | HostName client1.example.com | | |
# | User OurUser | | |
# | Port 8022 | | |
# |Host Client2 | | |
# | Hostname client2.example.com | | |
# | | | |
# |# Our Servers | | |
# |Host webserver | | |
# | Hostname ourdomain.com | | |
# | User OurUser | | |
# |Host fileserver | | |
# | Hostname fileserver.example.com| | |
# +----------------------------------+ | |
# | |
# | |
# example output: | |
# | |
# # Intranet | |
# Bilbo | |
# Frodo | |
# # Clients | |
# Client1 | |
# Client2 | |
# # Our Servers | |
# webserver | |
# fileserver | |
# | |
cat ~/.ssh/config | grep "Host \|# " | sed 's/Host //g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment