Timetombs

泛义的工具是文明的基础,而确指的工具却是愚人的器物

66h / 117a
,更新于 2024-04-27T21:37:28Z+08:00 by   25c71be

[Linux] Ubuntu

版权声明 - CC BY-NC-SA 4.0

1 Install

isourl
officialhttp://releases.ubuntu.com
163http://mirrors.163.com/ubuntu-releases
aliyunhttps://mirrors.aliyun.com/ubuntu-releases
legacyhttps://mirrors.tuna.tsinghua.edu.cn/ubuntu-cdimage/ubuntu-legacy-server/
vmhttp://cloud-images.ubuntu.com/bionic/current
sourceurl
163http://mirrors.163.com/.help/ubuntu.html
aliyunhttp://mirrors.aliyun.com/ubuntu/
ddehttps://www.deepin.org/original/deepin-boot-maker

2 Config

sudo passwd root
# /etc/ssh/sshd_cofig 
# PermitRootLogin yes
apt -y autoremove clean
Optimize-VHD -Path E:\_vhd\ubt1.vhdx -Mode Full
# 更改主机名
# /etc/hostname
# /etc/hosts

# 查看硬盘
fdisk -l

# 创建新分区 n w
gdisk /dev/sdb

# 格式化新分区
mkfs.xfs /dev/sdb1

# 挂载 /etc/fstab
# 查看uuid
blkid
# UUID=f1abf791-fe61-4dab-858f-632acb7d1d8f /data  ext4  defaults 0 0

3 Reference

# https://netplan.io/examples
# /etc/netplan/xxx.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      addresses:
        - 192.168.2.202/24
      dhcp4: no
      dhcp6: no
      gateway4: 192.168.2.1
      nameservers:
        addresses:
          - 192.168.2.1
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
# sudo bash <(wget -q -O - https://linianhui.github.io/linux/ubuntu/init.sh)

set -x

apt update \
    && apt -y install curl wget unzip tcpdump net-tools iproute2 vim jq coreutils tini gdisk\
    && apt -y autoremove \
    && apt -y clean

# 禁用防火墙
# ubuntu
ufw disable
# centos
systemctl stop firewalld
systemctl disable firewalld


# 禁用swap
sudo swapoff -a
# 永久禁用swap
cat /etc/fstab
cat /etc/fstab | grep -v swap > /etc/fstab
cat /etc/fstab


# 永久禁用SELINUX
tee <<-EOF /etc/selinux/config
SELINUX=disabled
EOF

# 禁用snap

# umount /snap/core* -lf
# snap remove core
# snap remove core18
# snap remove core20
# snap remove snapd
# snap remove snapd
# apt remove snapd --purge -y

# mount disk

# fdisk -l
# mount -l

# fdisk /dev/sdb
# mkfs.ext4 -G 4096 /dev/sdb1
# 挂载 /etc/fstab
# 查看uuid blkid
# UUID=f1abf791-fe61-4dab-858f-632acb7d1d8f /data ext4 defaults 0 0
上一篇 : [Linux] systemd
下一篇 : [Linux] CentOS