新装Debian系统的软件配置(APT、SSH、VIM)
类别: 入门到放弃
标签: Debian Linux
日期: 2023-12-01 | 作者:admin | 浏览: 50

由于CentOS再一年就不再支持了,遂寻找替代产品,找了一圈,发现还是Debian比较合适。正如官方说的:Debian是一个完全自由的操作系统,自由、稳定、安全、灵活,最主要的是,它是N多发行版的祖宗~~

官方网站:Debian - 通用操作系统

最新版(Debian 12,代号:bookworm)下载地址:Debian 12 (bookworm)

一、APT

apt是Debian及其衍生产品(例如Ubuntu)的主要命令行包管理器。其源地址文件为  /etc/apt/sources.list

如需更换软件源,修改此文件即可(推荐复制一份后更新)。

个人推荐清华大学镜像源:清华大学开源软件镜像站


# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware

更新并升级软件


apt update && apt upgrade

二、SSH

SSH(Secure Shell,简称SSH):是一种在不安全网络上用于安全远程登录和其他安全网络服务的协议。

常规的就是修改端口号及允许ROOT用户访问


vim /etc/ssh/sshd_config
# 修改端口号,默认为22端口
Port 2222
# 允许ROOT访问
PermitRootLogin yes

三、VIM

VIM是一个功能强大、高度可定制的文本编辑器


# 涉及VIM的修改有三个地方,主要是高亮显示及允许鼠标右键复制等
# 高亮显示
vim /etc/vim/vimrc
# 取消该行注释
syntax on

vim /root/.bashrc
# 取消如下注释
export LS_OPTIONS='--color=auto'
eval dircolors
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'

# 允许鼠标右键复制
vim /usr/share/vim/vim82/default.vim

if has('mouse')
    if &term =~ 'xterm'
# 在mouse=a的=前面加-,即mouse-=a (允许鼠标右键在xshell中正常使用)
      set mouse-=a
    else
      set mouse=nvi
    endif
endif

 

<