Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anatolykopyl/sshukh
Plugin to update known hosts automatically if needed
https://github.com/anatolykopyl/sshukh
oh-my-zsh oh-my-zsh-plugin ssh zsh zsh-plugin
Last synced: about 1 month ago
JSON representation
Plugin to update known hosts automatically if needed
- Host: GitHub
- URL: https://github.com/anatolykopyl/sshukh
- Owner: anatolykopyl
- License: gpl-3.0
- Created: 2021-04-03T12:36:36.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-18T09:13:16.000Z (over 3 years ago)
- Last Synced: 2024-05-21T06:08:25.053Z (8 months ago)
- Topics: oh-my-zsh, oh-my-zsh-plugin, ssh, zsh, zsh-plugin
- Language: Shell
- Homepage:
- Size: 21.5 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sshukh zsh plugin
*SSH Update Known Hosts*Prompts to update `known_hosts` file for you if needed.
## Installation:
**With Oh-my-zsh:** run the following command:
```
$ git clone https://github.com/anatolykopyl/sshukh.git $HOME/.oh-my-zsh/custom/plugins/sshukh
```
**With Antigen:** add the following to your `.zshrc`:
```
antigen bundle anatolykopyl/sshukh
```To always use with ssh (recommended) add this alias to your `.zshrc`:
```
alias ssh='sshukh'
```
Zsh may tell you that the plugin is disabled until permissions are fixed. Just run the command it suggests.
```
$ compaudit | xargs chmod g-w,o-w
```## Usage
Let's connect to an ip that changed hosts:
```
$ sshukh [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:vOsLgBskwRk1pvSpgpALYpdi/9WZ5OGB5iI+80Zkdg8.
Please contact your system administrator.
Add correct host key in /Users/akopyl/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/akopyl/.ssh/known_hosts:26
ECDSA host key for 192.168.1.54 has changed and you have requested strict checking.
Host key verification failed.
Update known_hosts? [y/n] y
# Host 192.168.1.54 found: line 26
/Users/akopyl/.ssh/known_hosts updated.
Original contents retained as /Users/akopyl/.ssh/known_hosts.old
```
There is a prompt asking if you want to remove the conflicting host from `known_hosts` and upon answering `y` ssh reruns automatically successfully.