Created
September 23, 2020 08:26
-
-
Save LukasRypl/5f4045db09daa3889fe927389ae63a0f to your computer and use it in GitHub Desktop.
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
function sshi --description 'new ssh peer' --argument ip | |
if test -n "$ip" | |
set v6can (ipv6calc -q $ip) | |
echo removing IP $ip and $v6can from known_hosts and sending my keys | |
set_color green | |
and ssh-keygen -R $ip | |
and ssh-keygen -R $v6can | |
and set_color normal | |
and ssh-copy-id root@$ip | |
else | |
echo Missing IP address | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment