Better security for ssh
This commit is contained in:
parent
024be39b5a
commit
5607ce7fe7
@ -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
|
(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
|
mv /tmp/sshd_config /etc/ssh/sshd_config
|
||||||
diff -urN /etc/ssh/sshd_config.bak /etc/ssh/sshd_config
|
diff -urN /etc/ssh/sshd_config.bak /etc/ssh/sshd_config
|
||||||
sshd -t
|
echo Errors:
|
||||||
mv /etc/ssh/sshd_config.bak /etc/ssh/sshd_config
|
sshd -t && echo None
|
||||||
EOF
|
EOF
|
||||||
echo "Running script..."
|
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'
|
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'
|
||||||
|
Loading…
Reference in New Issue
Block a user