From 5607ce7fe71bdd3cdc4b987bf27270115ecedebf Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Thu, 18 Aug 2016 00:57:47 -0400 Subject: [PATCH] Better security for ssh --- zsh/config.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zsh/config.zsh b/zsh/config.zsh index 66e77dd..3f2ca1c 100644 --- a/zsh/config.zsh +++ b/zsh/config.zsh @@ -15,8 +15,8 @@ sed -ri'' 's/^(\s*PermitRootLogin\s)/#\1/gI' /etc/ssh/sshd_config (echo -e "Protocol 2\nUseDNS no\nPermitEmptyPasswords no\nPermitRootLogin no\nIgnoreRhosts yes";cat /etc/ssh/sshd_config)>/tmp/sshd_config mv /tmp/sshd_config /etc/ssh/sshd_config diff -urN /etc/ssh/sshd_config.bak /etc/ssh/sshd_config -sshd -t -mv /etc/ssh/sshd_config.bak /etc/ssh/sshd_config +echo Errors: +sshd -t && echo None EOF echo "Running script..." ssh -t $* 'chmod +x /tmp/script.sh;command -v sudo >/dev/null 2>&1 && sudo /tmp/script.sh || /tmp/script.sh;rm /tmp/script.sh'