From 516beff5dc60b3ee5d87ece7199b932db22cfc17 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 8 Oct 2023 19:05:09 +0200 Subject: [PATCH] Add utils for managing my SSH keys --- .config/fish/conf.d/alias.fish | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.config/fish/conf.d/alias.fish b/.config/fish/conf.d/alias.fish index 2809ebd..0163923 100644 --- a/.config/fish/conf.d/alias.fish +++ b/.config/fish/conf.d/alias.fish @@ -6,3 +6,10 @@ alias mirrors_update "curl -s 'https://archlinux.org/mirrorlist/?country=FR&coun alias pacman-clean "sudo pacman -Rsn \$(pacman -Qqtd) --noconfirm" alias untgz "tar xvzf" alias paru-rebuild "checkrebuild | awk '{print \$2}' | xargs -r paru -S --rebuild=all --noconfirm" +alias ssh-export "tar czf '$HOME/SSH.tar.gz' $HOME/.ssh" +alias ssh-fix "sudo chown $USER:$(id -gn) $HOME/.ssh/* && \ + sudo chmod u=r,g=,o= $HOME/.ssh/*; \ + sudo chmod u=r,g=r,o=r $HOME/.ssh/*.pub; \ + sudo chmod u=r,g=r,o=r $HOME/.ssh/config; \ + sudo chmod u=rw,g=,o= $HOME/.ssh/environment 2>/dev/null; \ + sudo chmod u=rw,g=,o= $HOME/.ssh/known_hosts 2>/dev/null"