折腾All in one系列(三)
折腾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
41、安装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
参考:
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 CzrTuringB的博客!