前言

开启SHH服务

[email protected] ~ # systemctl start sshd         
[email protected] ~ # systemctl status sshd
● sshd.service - OpenSSH Daemon
     Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; preset: disabled)
     Active: active (running) since Thu 2022-09-15 04:38:35 UTC; 34min ago
   Main PID: 539 (sshd)
      Tasks: 1 (limit: 18650)
     Memory: 3.0M
        CPU: 197ms
     CGroup: /system.slice/sshd.service
             └─539 "sshd: /usr/bin/sshd -D [listener] 0 of 10-100 startups"

Sep 15 04:38:35 archiso sshd[539]: Server listening on :: port 22.
[email protected] ~ # passwd
New password: 
Retype new password: 
passwd: password updated successfully
[email protected] ~ #

设置时间

[email protected] ~ #  timedatectl set-ntp true
[email protected] ~ # timedatectl status
               Local time: Thu 2022-09-15 05:26:28 UTC
           Universal time: Thu 2022-09-15 05:26:28 UTC
                 RTC time: Thu 2022-09-15 05:26:28
                Time zone: UTC (UTC, +0000)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

分区

[email protected] ~ # fdisk -l /dev/nvme0n1                                                                                                                        
Disk /dev/nvme0n1: 465.76 GiB, 500107862016 bytes, 976773168 sectors                                                                               
Disk model: KINGSTON SNVS500G                        
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: D40E7459-C238-304D-995E-27300648B26D

Device           Start       End   Sectors   Size Type
/dev/nvme0n1p1    2048   1564547   1562500 762.9M EFI System
/dev/nvme0n1p2 1564672   9953279   8388608     4G Linux swap
/dev/nvme0n1p3 9953280 976773134 966819855   461G Linux filesystem
[email protected] ~ # cfdisk /dev/nvme0n1
[email protected] ~ # fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: KINGSTON SNVS500G                       
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: D40E7459-C238-304D-995E-27300648B26D

Device           Start       End   Sectors   Size Type
/dev/nvme0n1p1    2048   1050623   1048576   512M EFI System
/dev/nvme0n1p2 1050624   9439231   8388608     4G Linux swap
/dev/nvme0n1p3 9439232 976773119 967333888 461.3G Linux filesystem
[email protected] ~ # mkfs.fat -F32 /dev/nvme0n1p1 
mkfs.fat 4.2 (2021-01-31)
[email protected] ~ # mkswap /dev/nvme0n1p2 
Setting up swapspace version 1, size = 4 GiB (4294963200 bytes)
no label, UUID=7af88558-e1de-45c2-96f0-c01ed0d29d01
[email protected] ~ # mkfs.ext4 /dev/nvme0n1p3 
mke2fs 1.46.5 (30-Dec-2021)
/dev/nvme0n1p3 contains `ASCII text, with very long lines (501)' data
Proceed anyway? (y,N) y
Discarding device blocks: done                            
Creating filesystem with 120916736 4k blocks and 30236672 inodes
Filesystem UUID: ebccbf71-4d9f-4f6d-baec-0127b3cbb30e
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
        102400000

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (262144 blocks): 
done
Writing superblocks and filesystem accounting information: done
[email protected] ~ # mount /dev/nvme0n1p3 /mnt 
[email protected] ~ # mkdir /mnt/boot       
[email protected] ~ # mount /dev/nvme0n1p1 /mnt/boot
[email protected] ~ # swapon /dev/nvme0n1p2

安装系统

[email protected] ~ # reflector -c China -a 10 --sort rate --save /etc/pacman.d/mirrorlist
[email protected] ~ # pacstrap /mnt base base-devel dialog linux linux-firmware
[email protected] ~ # pacman -S archlinux-keyring
[email protected] ~ # arch-chroot /mnt
[[email protected] /]#
[[email protected] /]# pacman -S vim bash-completion neovim zsh intel-ucode ntfs-3g

系统初始化设置

[[email protected] /]# ln -sf /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime
[[email protected] /]# hwclock --systohc
[[email protected] /]# vim /etc/locale.gen
[[email protected] /]# locale-gen
Generating locales...
  en_US.UTF-8... done
  zh_CN.UTF-8... done
Generation complete.
[[email protected]iso /]#
[[email protected] /]# vim /etc/locale.conf
[[email protected] /]# cat /etc/locale.conf
LANG=zh_CN.UTF-8
[[email protected] /]# vim /etc/hostname
[[email protected] /]# vim /etc/hosts
[[email protected] /]# cat /etc/hosts
# Static table lookup for hostnames.
# See hosts(5) for details.
127.0.0.1       localhost
::1             localhost
127.0.0.1       LST.localdomain         LST

[[email protected] /]# cat /etc/hostname 
LST
[[email protected] /]# useradd -m -g users -G wheel -s /bin/zsh kali-team
[[email protected] /]# passwd kali-team
New password: 
Retype new password: 
passwd: password updated successfully
[[email protected] /]# visudo
## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL:ALL) ALL

配置引导

[[email protected] /]# pacman -S grub efibootmgr                                                                                                        
resolving dependencies...                                                                                                                          
looking for conflicting packages...                                                                                                                
                                                                                                                                                   
Packages (3) efivar-38-2  efibootmgr-18-1  grub-2:2.06.r322.gd9b4638c5-4                                                                           
                                                                                                                                                   
Total Download Size:    6.95 MiB                                                                                                                   
Total Installed Size:  33.65 MiB
:: Proceed with installation? [Y/n] 
:: Retrieving packages...
 grub-2:2.06.r322.gd9b4638c5-4-x86_64                          6.8 MiB  6.74 MiB/s 00:01 [###################################################] 100%
 efivar-38-2-x86_64                                          145.5 KiB  1819 KiB/s 00:00 [###################################################] 100%
 efibootmgr-18-1-x86_64                                       29.9 KiB   452 KiB/s 00:00 [###################################################] 100%
 Total (3/3)                                                   7.0 MiB  5.53 MiB/s 00:01 [###################################################] 100%
(3/3) checking keys in keyring                                                           [###################################################] 100%
(3/3) checking package integrity                                                         [###################################################] 100%
(3/3) loading package files                                                              [###################################################] 100%
(3/3) checking for file conflicts                                                        [###################################################] 100%
(3/3) checking available disk space                                                      [###################################################] 100%
:: Processing package changes...
(1/3) installing grub                                                                    [###################################################] 100%
:: Install your bootloader and generate configuration with:
     $ grub-install ...
     $ grub-mkconfig -o /boot/grub/grub.cfg
Optional dependencies for grub
    freetype2: For grub-mkfont usage
    fuse2: For grub-mount usage
    dosfstools: For grub-mkrescue FAT FS and EFI support
    lzop: For grub-mkrescue LZO support
    efibootmgr: For grub-install EFI support [pending]
    libisoburn: Provides xorriso for generating grub rescue iso using grub-mkrescue
    os-prober: To detect other OSes when generating grub.cfg in BIOS systems
    mtools: For grub-mkrescue FAT FS support
(2/3) installing efivar                                                                  [###################################################] 100%
(3/3) installing efibootmgr                                                              [###################################################] 100%
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Updating the info directory file...
[[email protected] /]#
[[email protected] /]# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=archlinux --recheck
Installing for x86_64-efi platform.
Installation finished. No error reported.
[[email protected] /]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-fallback.img
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

网络设置

[[email protected] /]# pacman -S nm-connection-editor dhcpcd
[[email protected] /]# systemctl enable sshd
Created symlink /etc/systemd/system/multi-user.target.wants/sshd.service → /usr/lib/systemd/system/sshd.service.
[[email protected] /]# systemctl enable NetworkManager
Created symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service → /usr/lib/systemd/system/NetworkManager.service.
Created symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service → /usr/lib/systemd/system/NetworkManager-dispatcher.service.
Created symlink /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service → /usr/lib/systemd/system/NetworkManager-wait-online.service.
[[email protected] /]# systemctl enable dhcpcd
Created symlink /etc/systemd/system/multi-user.target.wants/dhcpcd.service → /usr/lib/systemd/system/dhcpcd.service.

生成fstab

[email protected] ~ # genfstab -U /mnt >> /mnt/etc/fstab
[email protected] ~ # cat /mnt/etc/fstab 
# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/nvme0n1p3
UUID=ebccbf71-4d9f-4f6d-baec-0127b3cbb30e       /               ext4            rw,relatime     0 1

# /dev/nvme0n1p1
UUID=A12A-8861          /boot           vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro      0 2

# /dev/nvme0n1p2
UUID=7af88558-e1de-45c2-96f0-c01ed0d29d01       none            swap            defaults        0 0

卸载分区重启

[email protected] ~ # umount -R /mnt
[email protected] ~ # reboot

优化

LST% sh -c "$(curl -fsSL <https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh>)"                                                               
                                                                                                                                                   
Cloning Oh My Zsh...
remote: Enumerating objects: 1276, done.
remote: Counting objects: 100% (1276/1276), done.
remote: Compressing objects: 100% (1232/1232), done.
remote: Total 1276 (delta 24), reused 1199 (delta 24), pack-reused 0
接收对象中: 100% (1276/1276), 1.06 MiB | 32.00 KiB/s, 完成.
处理 delta 中: 100% (24/24), 完成.
来自 <https://github.com/ohmyzsh/ohmyzsh>
 * [新分支]          master     -> origin/master
分支 'master' 设置为跟踪 'origin/master'。
已经位于 'master'
/home/kali-team

Looking for an existing zsh config...
Using the Oh My Zsh template file and adding it to ~/.zshrc.

         __                                     __   
  ____  / /_     ____ ___  __  __   ____  _____/ /_  
 / __ \\/ __ \\   / __ `__ \\/ / / /  /_  / / ___/ __ \\ 
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / / 
\\____/_/ /_/  /_/ /_/ /_/\\__, /    /___/____/_/ /_/  
                        /____/                       ....is now installed!

Before you scream Oh My Zsh! look over the `.zshrc` file to select plugins, themes, and options.
• Follow us on Twitter: <https://twitter.com/ohmyzsh>
• Join our Discord community: <https://discord.gg/ohmyzsh>
• Get stickers, t-shirts, coffee mugs and more: <https://shop.planetargon.com/collections/oh-my-zsh>

➜  ~

我的软件列表

#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist

- [multilib]
- Include = /etc/pacman.d/mirrorlist
+ [multilib]
+ Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository.  See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs
+ [archlinuxcn]
+ Server = <https://repo.archlinuxcn.org/$arch>
➜  ~ sudo pacman -Sy && sudo pacman -S archlinuxcn-keyring
➜  ~ sudo pacman -S xorg xorg-server lightdm-gtk-greeter lightdm-gtk-greeter-settings networkmanager
➜  ~ sudo systemctl enable lightdm.service 
➜  ~ sudo systemctl enable NetworkManager
➜  ~ sudo pacman -S xf86-video-intel xorg-xinit i3 tilix
➜  ~ cp /etc/X11/xinit/xinitrc ./
➜  ~ mv xinitrc .xinitrc
➜  ~ sudo pacman -Sy picom polkit polkit-gnome fcitx fcitx-configtool fcitx-googlepinyin fcitx-cloudpinyin dex feh
软件 描述
firefox 唯一浏览器
i3status-rust 漂亮的状态栏
gedit 常用编辑器
obs-studio 录制视频
notion-app-enhanced notion客户端
pamac-aur 软件管理
keybase-gui keybase图形化客户端
seahorse 本地密码密钥管理
evolution 邮件客户端
remmina 远程桌面客户端
intellij-idea-community-edition 开发IDEA
clamtk 杀毒软件
flameshot 截图软件
greenclip 剪切板管理

结束

参考

https://wiki.archlinuxcn.org/wiki/简体中文本地化

https://wiki.archlinuxcn.org/wiki/应用程序列表

Powered by Kali-Team