debian12.4 simple configuration

1. system install

1) download link: https://cdimage.debian.org/mirror/cdimage/archive/12.4.0/amd64/iso-dvd/

2) install without desktop environment and with SSH Server

3) not use a network mirror

2.Part Security Hardening(optional)

upload public key

mkdir /root/.ssh && chmod 700 /root/.ssh  
upload Identity.pub into /root/.ssh  
chown root:root Identity.pub  
mv Identity.pub authorized_keys && chmod 600 authorized_keys  

/etc/ssh/sshd_config

Port  11022
ListenAddress 192.168.1.2
LoginGraceTime 30s
PubkeyAuthentication yes
AuthorizedKeysFile    .ssh/authorized_keys
PasswordAuthentication no
PermitEmptyPasswords no
X11Forwarding no
KbdInteractiveAuthentication no

3.update source.list(optional)

NOTE: debian12 codename bookworm
mv /etc/apt/sources.list /etc/apt/sources.list.bak

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-firmware
deb 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-firmware
deb 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://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware

4. update necessary software with user root

apt update  

dpkg -l | grep vim  
apt remove vim-tiny vim-common  
apt install vim  

apt install sudo

echo "alias ll='ls -al'" >>/etc/profile
source /etc/profile

5. static ip

service networking status
cp -prf /etc/network/interfaces /etc/network/interfaces.bak
vi /etc/network/interfaces
service networking restart

# 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 ens32
# iface ens32 inet dhcp

auto ens32
iface ens32 inet static
    address 192.168.1.7
    gateway 192.168.1.2

# iface ens32 inet6 static
#     address 2001:db8::c0ca:1eaf/64
#     gateway 2001:db8::1ead:ed:beef

6. Reference

debian wiki

Tags:

Categories:

Updated:

Comments