debian11 安装后必备配置

2024-01-15 08:59
文章标签 配置 安装 必备 debian11

本文主要是介绍debian11 安装后必备配置,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

debian11 安装后必备配置
运行环境:PVE v7.2-11 CT容器
系统版本:Debian-11-standard_11.3-1_amd64.tar.zst

启动信息

Debian GNU/Linux 11 debian tty1debian login: root
Password: 
Linux debian 5.15.64-1-pve #1 SMP PVE 5.15.64-1 (Thu, 13 Oct 2022 10:30:34 +0200) x86_64The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Nov 19 09:39:49 UTC 2022 on tty1
root@debian:~# 

版本信息

root@debian:~# 
root@debian:~# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
root@debian:~# 
root@debian:~# 
root@debian:~# cat /etc/debian_version
11.3
root@debian:~# 
root@debian:~# hostnamectlStatic hostname: debianIcon name: computer-containerChassis: containerMachine ID: 4241fde901b64f0d8731261862696790Boot ID: 8f9c38c2abc64384b1f12efd72c9f299Virtualization: lxcOperating System: Debian GNU/Linux 11 (bullseye)Kernel: Linux 5.15.64-1-pveArchitecture: x86-64
root@debian:~# 
root@debian:~# uname -a
Linux debian 5.15.64-1-pve #1 SMP PVE 5.15.64-1 (Thu, 13 Oct 2022 10:30:34 +0200) x86_64 GNU/Linux
root@debian:~# 

配置1:系统默认使用nano编辑器,也提供精简版的vim.tiny版,安装vim。

root@debian:~# 
root@debian:~# vim
-bash: vim: command not found
root@debian:~# 
root@debian:~# whereis vim
vim: /usr/bin/vim.tiny /etc/vim /usr/share/vim /usr/share/man/man1/vim.1.gz
root@debian:~# 
root@debian:~# apt install vim

配置2:系统默认是不能以root账户SSH登录的,需要修改配置使能。

scilogyhunter@debian:~$ sudo vim /etc/ssh/ssh_config
#修改或增加 PermitRootLogin yes 配置
scilogyhunter@debian:~$ 
scilogyhunter@debian:~$ sudo systemctl restart ssh  #重启SSH服务生效
scilogyhunter@debian:~$ 
scilogyhunter@debian:~$ su root
Password: 
root@debian:/home/scilogyhunter# 
root@debian:/home/scilogyhunter# 

配置3:安装sudo命令,创建管理员用户,后面都以此用户进行系统管理而不是root用户。

root@debian:~# useradd -m -s /bin/bash -G sudo scilogyhunter
root@debian:~# passwd scilogyhunter
root@debian:~# logoutDebian GNU/Linux 11 debian tty1debian login: scilogyhunter
Password: 
Linux debian 5.15.64-1-pve #1 SMP PVE 5.15.64-1 (Thu, 13 Oct 2022 10:30:34 +0200) x86_64The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
scilogyhunter@debian:~$ 

配置4:使用VScode远程SSH登录,会自动安装vscode-server,以后无论是命令行还是文件编辑都可以直接在VScode中进行,比命令行下用vim/nano编辑高效的多。
在这里插入图片描述

配置5:为了提高软件下载速度,建议更新源为国内镜像,这里选用阿里的源。

先备份sources.list,然后拷贝到用户目录,用VScode进行编辑,最后再拷回去覆盖院配置。

scilogyhunter@debian:~$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.back
scilogyhunter@debian:~$ cp /etc/apt/sources.list /home/scilogyhunter/sources.list
scilogyhunter@debian:~$ sudo cp /home/scilogyhunter/sources.list /etc/apt/sources.list

在这里插入图片描述
配置6:更新系统

scilogyhunter@debian:~$ sudo apt update  # 只检查是否有可用更新,给出汇总报告和提示信息scilogyhunter@debian:~$ sudo apt upgrade  # 更新已安装的软件包

配置5:开启常用指令别名和颜色显示
这个在对应用户目录下的.bashrc文件中其实已近存在,但是是注释状态,只要去掉注释即可。
在这里插入图片描述
该配置文件只有在用户登入时才执行,所以修改后需要程序登录一下。

scilogyhunter@debian:~$ ll
bash: ll: command not found
scilogyhunter@debian:~$ su scilogyhunter
Password: 
scilogyhunter@debian:~$ 
scilogyhunter@debian:~$ ll
total 4
-rw-r--r-- 1 scilogyhunter scilogyhunter 652 Nov 21 12:44 sources.list
-rw-r--r-- 1 scilogyhunter scilogyhunter   0 Nov 19 14:22 text

这篇关于debian11 安装后必备配置的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/608343

相关文章

windows下安装Nginx全过程

《windows下安装Nginx全过程》文章介绍了HTTP和反向代理服务器的概念,包括正向代理和反向代理的区别,并详细描述了如何安装和配置Nginx作为反向代理服务器... 目录概念代理正向代理反向代理安装基本属性nginx.conf查询结构属性使用运行重启停止总结概念是一个高性能的HTTP和反向代理we

Spring配置扩展之JavaConfig的使用小结

《Spring配置扩展之JavaConfig的使用小结》JavaConfig是Spring框架中基于纯Java代码的配置方式,用于替代传统的XML配置,通过注解(如@Bean)定义Spring容器的组... 目录JavaConfig 的概念什么是JavaConfig?为什么使用 JavaConfig?Jav

Spring Boot Interceptor的原理、配置、顺序控制及与Filter的关键区别对比分析

《SpringBootInterceptor的原理、配置、顺序控制及与Filter的关键区别对比分析》本文主要介绍了SpringBoot中的拦截器(Interceptor)及其与过滤器(Filt... 目录前言一、核心功能二、拦截器的实现2.1 定义自定义拦截器2.2 注册拦截器三、多拦截器的执行顺序四、过

springboot的controller中如何获取applicatim.yml的配置值

《springboot的controller中如何获取applicatim.yml的配置值》本文介绍了在SpringBoot的Controller中获取application.yml配置值的四种方式,... 目录1. 使用@Value注解(最常用)application.yml 配置Controller 中

springboot中配置logback-spring.xml的方法

《springboot中配置logback-spring.xml的方法》文章介绍了如何在SpringBoot项目中配置logback-spring.xml文件来进行日志管理,包括如何定义日志输出方式、... 目录一、在src/main/resources目录下,也就是在classpath路径下创建logba

C++多线程开发环境配置方法

《C++多线程开发环境配置方法》文章详细介绍了如何在Windows上安装MinGW-w64和VSCode,并配置环境变量和编译任务,使用VSCode创建一个C++多线程测试项目,并通过配置tasks.... 目录下载安装 MinGW-w64下载安装VS code创建测试项目配置编译任务创建 tasks.js

Nginx概念、架构、配置与虚拟主机实战操作指南

《Nginx概念、架构、配置与虚拟主机实战操作指南》Nginx是一个高性能的HTTP服务器、反向代理服务器、负载均衡器和IMAP/POP3/SMTP代理服务器,它支持高并发连接,资源占用低,功能全面且... 目录Nginx 深度解析:概念、架构、配置与虚拟主机实战一、Nginx 的概念二、Nginx 的特点

2025最新版Android Studio安装及组件配置教程(SDK、JDK、Gradle)

《2025最新版AndroidStudio安装及组件配置教程(SDK、JDK、Gradle)》:本文主要介绍2025最新版AndroidStudio安装及组件配置(SDK、JDK、Gradle... 目录原生 android 简介Android Studio必备组件一、Android Studio安装二、A

前端Visual Studio Code安装配置教程之下载、汉化、常用组件及基本操作

《前端VisualStudioCode安装配置教程之下载、汉化、常用组件及基本操作》VisualStudioCode是微软推出的一个强大的代码编辑器,功能强大,操作简单便捷,还有着良好的用户界面,... 目录一、Visual Studio Code下载二、汉化三、常用组件1、Auto Rename Tag2

SpringBoot18 redis的配置方法

《SpringBoot18redis的配置方法》本文介绍在SpringBoot项目中集成和使用Redis的方法,包括添加依赖、配置文件、自定义序列化方式、使用方式、实际使用示例、常见操作总结以及注意... 目录一、Spring Boot 中使用 Redis1. 添加依赖2. 配置文件3. Redis 配置类