新装的 Linux 系统所需要做的配置工作总结
持续更新中!
网络配置
更换 ip 和 dns (虚拟机常用)
到 /etc/network/interfaces
和 /etc/resolv.conf
修改.
具体可见 https://blog.juis.top/posts/18c2a451.html
更换 apt 源
比如清华源可以进入 https://mirror.tuna.tsinghua.edu.cn/help/debian/ 选择版本
以 debian-11 bullseye 为例如下
sh
1 | # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 |
以及一些更新软件源
sh
1 | apt update |
可能需要网络代理
参考 https://blog.juis.top/posts/b22f73a1
终端配置
设置用户的终端提示颜色
在 ~/.bashrc
文件里更改
debian 系统可以直接照抄如下
sh
1 | # ~/.bashrc: executed by bash(1) for non-login shells. |
ssh 设置
在 /etc/ssh/ssh_config
添加如下防止断连
txt
1 | ServerAliveInterval 60 |
允许 root 远程登录
sh
1 | vim /etc/ssh/sshd_config |
免密登录
把自己的公钥复制到服务器的 ~/.ssh/authorized_keys
sh
1 | vim ~/.ssh/authorized_keys |
此外还要保证 /etc/ssh/sshd_config
如下没被注释
text
1 | RSAAuthentication yes |
添加用户
sh
1 | useradd -m -s /bin/bash user |
常用环境
docker:
sh
1 | sudo curl -fsSL https://get.docker.com > get-docker.sh |
参考文章
本博客采用 CC BY-NC-SA 4.0 许可。转载请声明来自 Juice's Blog!