From b1eb4faec51b71be855d62e0d89c465073be1754 Mon Sep 17 00:00:00 2001 From: ddv12138 <644077730@qq.com> Date: Sat, 26 May 2018 15:44:45 +0800 Subject: [PATCH] =?UTF-8?q?2017=E5=B9=B4=2011=E6=9C=88=2025=E6=97=A5=20?= =?UTF-8?q?=E6=98=9F=E6=9C=9F=E5=85=AD=2014:10:23=20CST?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backup-seafile-here.sh | 1 + initseafile.sh | 9 +++++++++ secure_ssh.sh | 13 +++++++++++++ 3 files changed, 23 insertions(+) create mode 100755 backup-seafile-here.sh create mode 100644 initseafile.sh create mode 100755 secure_ssh.sh diff --git a/backup-seafile-here.sh b/backup-seafile-here.sh new file mode 100755 index 0000000..5e069e9 --- /dev/null +++ b/backup-seafile-here.sh @@ -0,0 +1 @@ +rsync -vzrtopg --progress -e ssh --delete root@pineapple.cf:/opt/seafile-data/* /seafile-backup/ diff --git a/initseafile.sh b/initseafile.sh new file mode 100644 index 0000000..025c62d --- /dev/null +++ b/initseafile.sh @@ -0,0 +1,9 @@ +docker run -d --name seafile \ + -e SEAFILE_SERVER_LETSENCRYPT=true \ + -e SEAFILE_SERVER_HOSTNAME=proxy.ddvudo.cf \ + -e SEAFILE_ADMIN_EMAIL=644077730@qq.com \ + -e SEAFILE_ADMIN_PASSWORD=liukang951006 \ + -v /seafile-data:/shared \ + -p 80:80 \ + -p 443:443 \ + seafileltd/seafile:latest diff --git a/secure_ssh.sh b/secure_ssh.sh new file mode 100755 index 0000000..79fd87a --- /dev/null +++ b/secure_ssh.sh @@ -0,0 +1,13 @@ +#! /bin/bash +cat /var/log/secure|awk '/Failed/{print $(NF-3)}'|sort|uniq -c|awk '{print $2"="$1;}' > /usr/local/bin/black.list +for i in `cat /usr/local/bin/black.list` +do + IP=`echo $i |awk -F= '{print $1}'` + NUM=`echo $i|awk -F= '{print $2}'` + if [ ${#NUM} -gt 1 ]; then + grep $IP /etc/hosts.deny > /dev/null + if [ $? -gt 0 ];then + echo "sshd:$IP:deny" >> /etc/hosts.deny + fi + fi +done