配置服务器

-
-
2022-12-22

Created:     2022-012-22 01:05     Modified:     2023-05-04 02:52

 

0x00 序

小鸡不堪重负,于是决定斥巨购入新机

下面是及其的配置记录

0x01 VPS2arch

archuser服务器也必须arch

一般系统直接使用vps2arch脚本就成了

0x02 改密码和公钥

0x03 设置主机名

echo “hostname” > /etc/hostname

0x04 设置时区

# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# hwclock --hctosys

0x05 安装必要工具

pacman -S vim base-devel zsh curl wget git htop neofetch

0x06 设置普通用户

useradd  -m -G wheel -s /usr/bin/zsh newuser

passwd newuser

0x07 配置sudoer

export EDITOR=vim  
visudo去注释

%wheel ALL=(ALL) ALL

0x08 切换用户

su newuser

0x09 添加archlinuxcn源

编辑 /etc/pacman.conf ,在文件末尾添加

[archlinuxcn]
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch

之后执行

sudo pacman -Syy

sudo pacman -S archlinuxcn-keyring

0x0a 安装aurhelper

sudo pacman -S yay

yay已经不再维护,开始使用paru

sudo pacman -S paru

0x0b 配置zsh

sudo pacman -S zsh-autosuggestions zsh-syntax-highlighting zsh-theme-powerlevel10k zsh-completions

zshrc中配置

source /usr/share/zsh-theme-powerlevel10k/powerlevel9k.zsh-theme
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

0x0c 设置swapfile

# dd if=/dev/zero of=/swapfile bs=1M count=8192 status=progress
# chmod 600 /swapfile
# mkswap /swapfile
# swapon /swapfile
# echo “/swapfile none swap defaults 0 0” >> /etc/fstab

 

 

 

“您的支持是我持续分享的动力”

微信收款码
微信
支付宝收款码
支付宝

目录