树莓派3b 安装arch linux 2

配置swap

swapon /dev/mmcblk0p3
nano /etc/fstab
/dev/mmcblk0p3  swap    swap    defaults        0       0

更换国内更新源

nano /etc/pacman.d/mirrorlist

在顶部添加

Server = https://mirrors.ustc.edu.cn/archlinuxarm/$arch/$repo
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch

初始化pacman

pacman-key --init
pacman-key --populate archlinuxarm

更新系统

pacman -Syu

配置ssh 使用公钥登录

port XXXX #更换一个端口
PubkeyAuthentication yes
PermitRootLogin no
StrictModes yes
PasswordAuthentication no
PermitEmptyPasswords no

生成ssh key

cd ~
mkdir .ssh
touch authorized_keys
ssh-keygen -t ed25519 -f root

把root.pub的内容复制到 authorized_keys 中

chmod 400 authorized_keys
chmod 700 ~/.ssh

禁止root用户登录

chsh root -s /sbin/nologin

EOF

猜你喜欢

转载自www.cnblogs.com/BD1A489/p/10384618.html
今日推荐