Skip to content

Instantly share code, notes, and snippets.

@LukasRypl
Created September 23, 2020 08:26
Show Gist options
  • Save LukasRypl/5f4045db09daa3889fe927389ae63a0f to your computer and use it in GitHub Desktop.
Save LukasRypl/5f4045db09daa3889fe927389ae63a0f to your computer and use it in GitHub Desktop.
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