add the old snippet md files
This commit is contained in:
parent
fc0dd204c7
commit
bcf8313a4b
110 changed files with 3048 additions and 0 deletions
41
old_snippets/short-server-names.en.md
Normal file
41
old_snippets/short-server-names.en.md
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
title: "using short server names"
|
||||
date: 2020-08-12T12:04:32+02:00
|
||||
draft: false
|
||||
snippet_types:
|
||||
- ssh
|
||||
---
|
||||
|
||||
It use to be when I was trying to ssh into one of my servers I would just: <Ctrl><r> in the shell to
|
||||
get my fzz backwards command search, type ssh, then scroll up and down until I found the correct server. As
|
||||
my number of servers has grown this is no longer manageable because I don't remember which IPs align
|
||||
with with server. Time for some human readable names.
|
||||
|
||||
By adding something like this to your `~/.ssh/config`:
|
||||
|
||||
```
|
||||
Host de1
|
||||
HostName vxxxxxxxxxxxxxxxxxxxx.megasrv.de
|
||||
User travis
|
||||
|
||||
Host de2
|
||||
HostName vyyyyyyyyyyyyyyyyyyyymegasrv.de
|
||||
User travis
|
||||
|
||||
Host de3
|
||||
HostName vzzzzzzzzzzzzzzzzzzz.megasrv.de
|
||||
User travis
|
||||
|
||||
Host nyc1
|
||||
HostName 123.123.123.1233
|
||||
User travis
|
||||
```
|
||||
|
||||
sshing becomes as easy as:
|
||||
|
||||
|
||||
```shell
|
||||
$ ssh de2
|
||||
```
|
||||
|
||||
source -- https://www.techrepublic.com/article/how-to-use-per-host-ssh-configuration/
|
||||
Loading…
Add table
Add a link
Reference in a new issue