43 lines
666 B
Markdown
43 lines
666 B
Markdown
# sshrm
|
|
|
|
Remove an entry from `~/.ssh/known_hosts` by host name or by line number.
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
sshrm [-h|--help] [--no-backup] host|line_number
|
|
```
|
|
|
|
## Options
|
|
|
|
- `-h`, `--help` Show help and exit.
|
|
- `--no-backup` Skip creating `~/.ssh/known_hosts.sshrm.bak`.
|
|
|
|
## Examples
|
|
|
|
Remove by host:
|
|
|
|
```bash
|
|
sshrm example.com
|
|
```
|
|
|
|
Remove by line number:
|
|
|
|
```bash
|
|
sshrm 12
|
|
```
|
|
|
|
Remove without backup:
|
|
|
|
```bash
|
|
sshrm --no-backup example.com
|
|
```
|
|
|
|
## Notes
|
|
|
|
- Line numbers must be positive integers.
|
|
- Extra arguments are rejected.
|
|
- The script asks for confirmation before removal.
|
|
- The script edits `~/.ssh/known_hosts`.
|
|
- Keep a backup if you need to recover entries.
|