debian11 安装后必备配置

阅读: 评论:0

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="/"
SUPPORT_URL=""
BUG_REPORT_URL="/"
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/
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

本文发布于:2024-01-29 02:29:46,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170646659112055.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23