折腾All in one系列(三)


系列文章


第一部分 服务器环境配置

第一章 初始配置

  • Root用户无法使用ssh登陆问题的解决方法:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    #切换至root用户
    su
    #编辑ssh_config配置文件
    nano /etc/ssh/sshd_config
    #找到下面片段,添加PermitRootLogin yes语句
    ----
    #LoginGraceTime 2m
    #PermitRootLogin prohibit-password
    PermitRootLogin yes
    #StrictModes yes
    #MaxAuthTries 6
    ----
    #编辑完成后重启sshd服务
    systemctl restart sshd
  • Debian12换源:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    #编辑源文件
    nano /etc/apt/sources.list
    #注释官方源内容,并添加下面的内容
    deb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
    deb-src https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
    deb https://mirrors.aliyun.com/debian-security/ bookworm-security main
    deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main
    deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
    deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
    deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
    deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
    #更新软件源
    apt updte
    apt upgrade
  • 必要的软件安装:

    1
    2
    3
    4
    #1、安装vim编辑器
    apt install vim
    #2、安装sudo命令工具
    apt install sudo
  • 普通用户无法使用sudo命令的问题解决:

    1
    2
    3
    4
    5
    #切换至root用户
    su
    vim /etc/sudores
    #添加
    czr ALL=(ALL:ALL) ALL

第二章 C/C++配置

  • 环境配置:

    1
    2
    3
    4
    5
    6
    #安装build-essential开发工具包,里面包括:gcc、g++、make、常用的c/c++的头文件
    apt install build-essential
    #查看gcc版本
    gcc --version
    #查看g++版本
    g++ --version

参考: