debian11 安装后必备配置

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

启动信息

Debian GNU/Linux 11 debian tty1

debian 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_64

The 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:~# hostnamectl
   Static hostname: debian
         Icon name: computer-container
           Chassis: container
        Machine ID: 4241fde901b64f0d8731261862696790
           Boot ID: 8f9c38c2abc64384b1f12efd72c9f299
    Virtualization: lxc
  Operating System: Debian GNU/Linux 11 (bullseye)
            Kernel: Linux 5.15.64-1-pve
      Architecture: 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:~# logout

Debian GNU/Linux 11 debian tty1

debian 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_64

The 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
  • 0
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
Debian 11是一款流行的开源操作系统,下面是关于如何安装配置Debian 11的指南: 1. 下载Debian 11的安装镜像文件并刻录至启动盘或者使用虚拟机加载。 2. 插入启动盘或者启动虚拟机,并选择启动设备为安装镜像。 3. 进入Debian 11的安装界面后,选择语言和地区,并设置键盘布局。 4. 选择“安装”以开始安装过程。 5. 根据提示选择时区、设置主机名和域名。 6. 创建一个用于登录系统的用户帐户,设置密码。 7. 选择磁盘分区方式,你可以选择手动分区或者使用自动分区工具。 8. 等待系统安装完成后,重新启动计算机。 9. 安装完成后,使用上一步中创建的用户帐户登录系统。 至此,你已经完成了Debian 11的安装,接下来可以进行一些配置: 1. 更新软件包:使用命令`sudo apt update`和`sudo apt upgrade`更新系统上的软件包到最新版本。 2. 安装常用软件:根据你的需求,可以使用`sudo apt install`命令安装各种软件,如文本编辑器、浏览器等等。 3. 配置网络:可以使用Network Manager来配置网络连接,使用`nmtui`命令可以打开一个文本界面来配置网络连接。 4. 设置防火墙:Debian 11默认使用iptables防火墙,你可以使用`sudo ufw`命令来配置防火墙规则。 5. 安装其他软件源:你可以根据需要添加其他软件源,例如非自由软件源,以便安装一些非免费软件。 6. 配置用户和权限:通过命令`sudo adduser`和`sudo usermod`可以添加、修改和管理用户,使用`sudo visudo`可以编辑sudoers文件来配置用户权限。 通过以上步骤,你可以完成Debian 11的安装和基本配置。在日常使用中,你可以根据自己的需要继续进行其他的配置和优化。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ScilogyHunter

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值