linux初始化布局(Debian 12 bookworm)

news/2025/3/15 21:03:38/文章来源:https://www.cnblogs.com/nanoric/p/18774091

创建工作用户

  • 首先创建一个新的用户
    adduser {用户名}
  • 将该用户名纳入sudo名单内
    nano /etc/sudoers,并在root下方一行编辑{用户名} ALL=(ALL:ALL)ALL

换源

  1. 换源第一步
    nano /etc/apt/source.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-firmwaredeb 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-firmwaredeb 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://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
  1. 换源第二步
    nano /etc/apt/sources.list.d/debian.sources替换为以下内容
Types: deb
URIs: https://mirrors.tuna.tsinghua.edu.cn/debian
Suites: bookworm bookworm-updates bookworm-backports
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
# Types: deb-src
# URIs: https://mirrors.tuna.tsinghua.edu.cn/debian
# Suites: bookworm bookworm-updates bookworm-backports
# Components: main contrib non-free non-free-firmware
# Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
Types: deb
URIs: https://security.debian.org/debian-security
Suites: bookworm-security
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg# Types: deb-src
# URIs: https://security.debian.org/debian-security
# Suites: bookworm-security
# Components: main contrib non-free non-free-firmware
# Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

注意:先不要更新软件


安装常用软件

  • 切换用户su - {用户名}
  • 更新软件列表sudo apt update
  • 安装系统必备软件
    sudo apt install net-tools openssh-server sudo curl wget tar unzip zip htop nohup telnet tar iptables pkill [-y]
  • 修改ll为ls -al
    cd ~ && echo "alias ll='ls -al'" >> .bashrc
  • ssh配置并禁止密码登录
# 服务端
stty -echo
echo "请手动编辑sshd_config文件,修改\n\Port xxxx\nPubkeyAuthentication yes\nPasswordAuthentication no\nPermitRootLogin no"
echo "准备进入文档编辑,等待阅读中...(10秒)"
sleep 10
sudo nano /etc/ssh/sshd_config
echo "请自行检查是否修改成功"
stty echo
# 客户端
sudo apt install openssh-client -yes
ssh-keygen -t rsa -f ~/.ssh/ssh_key
ssh-copy-id {服务端用户名}@{服务端IP}

这样初始化基本就完成了

待完善

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/899379.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Android开发--Lesson01--页面布局

一.View视图 在Android开发中所有的UI元素都是由View和ViewGroup构建而成的。ViewGroup作为一个容器既可以装载View视图空间,同时也可装载ViewGroup。即一种布局可以嵌套另一种布局。二.ViewGroup RelativeLayout RelativeLayout是Android中一种非常灵活的布局方式,它允许子…

第十八届全国大学生信息安全竞赛暨第二届“长城杯”铁人三项赛web方向部分wp

第十八届全国大学生信息安全竞赛暨第二届“长城杯”铁人三项赛web方向部分wp hello_web查看源代码发现有两个文件,访问一下Tips是phpinfo 里面可以看到disable_functions hackme.php中$lapUCm=urldecode("%6E1%7A%62%2F%6D%615%5C%76%740%6928%2D%70%78%75%71%79%2A6%6C%…

使用WLAN接口将温度和相对湿度发送到家庭网络web服务器

在本文中,我想利用WLAN接口,为家庭网络中的web服务器提供温度和相对湿度。但是,我将使用物有所值的DHT20传感器和带有SH1106驱动IC的1.3英寸OLED,以尽量减少重复。 但首先是树莓派Pico W的引脚图,以及树莓派Pico和Pico W的区别:虽然外形尺寸和引脚(很大程度上)保持不变,…

【水】洛谷 P3913 (待续)

今天NaN在刷水题时碰到这么一道题:洛谷P3913 https://www.luogu.com.cn/problem/P3913 代码的思路特别简单:用全部格子数 - 没被車侵占的行数 \(\times\) 列数即可. code void solve() {cin >> n >> k;g = h = n;for (ll i = 1; i <= k; i++){cin >> x …

web77笔记(POST+FFI)

web77 命令执行最后一题,php7.4 FFI,php7.4以上才有 https://www.php.net/manual/zh/ffi.cdef.php https://www.php.cn/php-weizijiaocheng-415807.html $ffi = FFI::cdef("int system(const char *command);");//创建一个system对象 $a=/readflag > 1.txt;//没…

day:22 python函数——介绍及自定义函数运用

一.函数的定义 函数是组织好,可以重复使用,用来实现单一,或者关联功能的代码段 二.pycharm中运用的结构三.函数的优点? a.降低代码的冗余 b.增加代码的复用性,提高开发效率 c.提高程序的拓展性 d.把代码片段放在函数当中 四.定义函数 (1)自定义函数 (一)自定义函数 a.函数格式…

英语单词音标重读符号读法作用

比如explicit,重读的是`后面的第一个元音即i

量子网络操作系统 QNodeOS 资料收集

2025年3月14日,通过科技日报的报道知道了这个量子计算领域的重大突破 —— 全球首个量子网络操作系统 QNodeOS 问世。欧洲的量子互联网联盟(QIA)的研究人员2025年3月12日在《自然》(Nature)杂志上发表了论文 An operating system for executing applications on quantum n…

Typora的基本的一些使用用法

markdown 标题 二级标题 (在最前面两个#号加空格) 三级标题 (在最前面三个#号加空格) 字体 Hello,World!(粗体:两边各两个星号) Hello,World!(斜体:两边各一个星号) Hello,World!(粗体加斜体:两边各三个星号) Hello,World!(删除体:两边各两个波浪号) 引用(大于加…

http--nodejs原生web服务

创建http服务const http = require(node:http) const url = require(node:url)http.createServer((req, res) => {}).listen(98, () => {console.log(server is running on port 98) }) 区分请求方法 例如常见的 POST、GET req表示前端的入参(请求参数)。 res 表示后…

Windows server 中 静默安装SQL SERVER 数据库 命令 参数

这篇文章记录一下自己如何在Windows Server Core上安装和配置SQL Server。 安装之前的检查 安装SQL Server的操作系统要求检查 第一件事是需要仔细检查SQL Server的要求文档,这个文档里详细的列出了目前SQL Server支持的操作系统版本,最重要的一条就是检查当你在使用云上的虚…

(3).工厂方法模式

我们接上一个模式的实例: (1).创建水果接口 IFruit:1 namespace 工厂方法模式2 {3 public interface IFruit4 {5 /// <summary>6 /// 水果的单价7 /// </summary>8 double Amount { get; }9 10 11 /// <s…