debian初始化:

connect using SSH -->

    sudo su
    passwd root
    useradd appadmin
    passwd appadmin

打开SSH配置文件/etc/ssh/sshd_config,使用root权限进行编辑:

    vim /etc/ssh/sshd_config
 PermitRootLogin no                         //允许root登录      
 PasswordAuthentication yes                 //设置是否使用口令验证
    service sshd reload

在root账号下,执行如下命令安装sudo。

apt install sudo -y

添加你的本地用户到 sudo 组,可以使用 usermod 命令,如下:

usermod -aG sudo linux265

校正日期和时间:
-- 时区列表

    timedatectl list-timezones

-- 修改系统时区为亚洲/上海

    sudo timedatectl set-timezone Asia/Shanghai

-- 查看

    timedatectl

进行系统更新:

    sudo apt update
    sudo apt upgrade -y

完成后安装常用软件:

    sudo apt-get install zsh wget curl zip git vim -y

1.没有ls命令:

    vi /root/.bashrc 
    . /root/.bashrc 

2.创建shadowsock,查看官网最新版本
参考:https://github.com/shadowsocks/shadowsocks-rust
例如:

  • 下载:download shadowsocks

      wget https://github.com/shadowsocks/shadowsocks-rust/releases/download/v1.16.1/shadowsocks-v1.16.1.x86_64-unknown-linux-gnu.tar.xz
  • 处理

      tar -xf shadowsocks-v1.16.1.x86_64-unknown-linux-gnu.tar.xz 
      mv ss* /usr/local/bin/.
      cd /etc
      mkdir shadowsocks
      cd shadowsocks/
      vi config.json
      ssserver -c /etc/shadowsocks/config.json
      nohup ssserver -c /etc/shadowsocks/config.json &
      ps -ef|grep sss
  • 加入系统服务:

      cd /etc/systemd/system/
      vi shadowsocks.service
      input:
      
      [Unit]
      Description=Shadowsocks Logging Service
      [Service]
      Type=simple
      ExecStart=/usr/local/bin/ssserver -c /etc/shadowsocks/config.json
      [Install]
      WantedBy=multi-user.target
      
      systemctl daemon-reload
      systemctl enable shadowsocks
      systemctl start shadowsocks

3.安装fail2ban:

    apt-get install fail2ban
    
    systemctl status fail2ban
    cd /etc/fail2ban/
    cp jail.local .
    
    systemctl start fail2ban