Manage known_hosts with hosts-* commands
masterThese commands manage the $HOME/.ssh/known_hosts file to ensure correct permissions and entry management.
Initialize known_hosts
hosts-init creates the $HOME/.ssh/known_hosts file with default permissions of 600.
Add a host key
hosts-add [key] adds a new entry to the known_hosts file and ensures the file permissions remain correct.
- Argument: The new key string to add.
Clear known_hosts
hosts-clear truncates the known_hosts file, effectively removing all known host entries.
hosts-init
hosts-add "ssh-rsa AAAAB3Nza..."
hosts-clear