首页 > 其他分享 >debian12

debian12

时间:2024-06-20 14:43:42浏览次数:13  
标签:network bashrc interfaces etc debian12 root ens18

#!/bin/bash

# 启用root登录
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
systemctl restart sshd

# 个性化设置
echo "alias ll='ls -l'" >> /root/.bashrc && source /root/.bashrc

# 静态ip
cat > /etc/network/interfaces << EOF
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug ens18
iface ens18 inet static
address 192.168.2.100
netmask 255.255.255.0
gateway 192.168.2.1
dns-nameservers 8.8.8.8 114.114.114.114
 chmod +x /usr/local/bin/docker-compose

# 替换清华源
cat > /etc/apt/sources.list<< EOF
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmware
# deb-src https://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmware

deb https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmware
# deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmware

deb https://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free non-free-firmware

deb https://mirrors.aliyun.com/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://mirrors.aliyun.com/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
EOF

# 更新包列表和升级已安装的软件包
apt update -y &&  apt upgrade -y

# 安装常用软件
apt install -y vim sudo net-tools curl unzip zip tmux wget zsh lrzsz

# 安装docker
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

# 安装docker-compose
wget https://github.com/docker/compose/releases/latest/download/docker-compose-Linux-x86_64
mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
echo "alias dc='docker-compose'" >> /root/.bashrc && source /root/.bashrc

网卡配置文件路径 /etc/network/interfaces
动态ip配置

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug ens18
iface ens18 inet dhcp

静态ip配置

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug ens18
iface ens18 inet static
address 192.168.2.100
netmask 255.255.255.0
gateway 192.168.2.1
dns-nameservers 8.8.8.8 114.114.114.114
```a

标签:network,bashrc,interfaces,etc,debian12,root,ens18
From: https://www.cnblogs.com/ppmdz/p/18258635

相关文章

  • debian12升级内核
    参考检查当前内核版本uname-r升级系统包sudoaptupdate查找最新的Debian12内核sudoapt-cachesearchlinux-image升级内核sudoaptinstall<linux_image_version>比如:sudoaptinstalllinux-image-6.5.0-0.deb12.4-amd6验证安装rambo@test1:~$dpkg--list|......
  • Windows 迁移至 Linux(debian12) 实验
    〇、前言最近用的Windows出现太多恶性故障,重装系统到怀疑人生,打算彻底抛弃栊子平台了,无法得知是内网被攻击还是细软作祟,反正彻底生气了,不能转换也必须得转换至linux了,宁愿多折腾Linux也不想在闭源的windows上干等干受折磨了。目前大概整理了以下表格,用于替换,之后会进行......
  • 在debian12上安装kvm的虚拟机
     主要参考:    https://wiki.debian.org/KVM#Installation     https://cloud-atlas.readthedocs.io/zh-cn/latest/kvm/libvirt/virt-install_location_iso_image.html  创建vm时使用的命令:      virt-install--namedebian\--os-variantdebian......
  • Linux Debian12 部署MySql 并建立外部连接
    一.下载MySql下载最新软件包。也可以在命令界面下使用下载最新的发行包。wgethttps://repo.mysql.com/mysql-apt-config_0.8.29-1_all.deb下载完成后,使用命令进行安装dpkg-imysql-apt-config_0.8.29-1_all.deb执行完后会跳转到安装MySql配置界面​TAB进行保存,选中OK,然......
  • Debian12安装VNC及novnc
    在安装VNC前,应该先行安装好GUI桌面,我使用的是KDE。安装VNCsudoaptinstalltigervnc-standalone-servertigervnc-commontightvncserver切换到需连接VNC的用户并设置VNC的密码:suuservncpasswd按提示设置好密码后,安装novnc:sudoaptinstallnovnc切换到需连接V......
  • Linux Debian12 部署MySql 并建立外部连接
    一.下载MySql下载最新软件包。也可以在命令界面下使用下载最新的发行包。wgethttps://repo.mysql.com/mysql-apt-config_0.8.29-1_all.deb下载完成后,使用命令进行安装dpkg-imysql-apt-config_0.8.29-1_all.deb执行完后会跳转到安装MySql配置界面​ TAB进行保......
  • debian12 timeshift无法正常运行,手动进行timeshift快照还原
    起因,/etc不小心被我删了注意,系统重要的话最好先用虚拟机练习一下一.挂载文件系统sudomount/dev/sdxn/mnt/dev/sdxn是你的块设备二.查看文件系统目录cd/mntls会出现@@hometimeshift-btrfs三.还原快照(1)先删除目标子卷sudorm-r@(2)再还原目标快照......
  • debian12源
     修改源  vim/etc/apt/sources.list阿里云源debhttps://mirrors.aliyun.com/debian/bookwormmainnon-freenon-free-firmwarecontribdeb-srchttps://mirrors.aliyun.com/debian/bookwormmainnon-freenon-free-firmwarecontribdebhttps://mirrors.aliyun.com/d......
  • debian12安装使用distrobox来启动gui程序
    1.安装distroboxsudoaptinstalldistrobox这里默认使用的容器管理工具是podman,不是docker2.配置podman的注册表以下载镜像在/etc/containers/registries.conf.d/00-unqualified-search-registries.conf添加unqualified-search-registries=["docker.io"]网速不行的话......
  • 修复或重新安装debian12linux的/boot分区,efi引导
    一.使用live系统二.挂载块设备三.chroot到/mnt,用arch-chroot比较方便四.开始重新安装/boot下的文件有config-6.1.0-18-amd64grub System.map-6.1.0-18-amd64efi initrd.img-6.1.0-18-amd64vmlinuz-6.1.0-18-amd64注意我的是amd架构,换成你的架构1.efi......