linux系统创建sftp用户并设置chroot

创建用户,设置密码 1 2 3 4 5 6 7 8 sudo groupadd sftp-grp sudo useradd -s /bin/false -m -G sftp-grp,www-data sftpuser sudo chpasswd <<< "sftpuser:123456" #设置密钥,密钥密码为空,可选项 sudo -u sftpuser ssh-keygen -f ~sftpuser/.ssh/id_rsa -t rsa -N '' sudo cat ~sftpuser/.ssh/id_rsa.pub | sudo -u sftpuser tee -a ~sftpuser/.ssh/authorized_keys sudo chmod

Fail2ban

1 2 3 4 5 6 7 8 9 sudo apt-get install -y fail2ban cat << EOF | sudo tee /etc/fail2ban/jail.d/sshd.local [sshd] enabled = true port = 23422 EOF sudo systemctl reload fail2ban

Debian升级Testing

执行命令 美国源为例,阿里源改为http://mirrors.aliyun.com/debian/即可 1 2 3 echo 'deb http://ftp.us.debian.org/debian/ testing main' | sudo tee /etc/apt/sources.list.d/testing.list sudo apt-get update && apt-get -y upgrade sudo