NYCU SA 2022 HW1

計算機系統管理 Computer System Administration

Spec

Check Point

HW1

Setup

1
2
3
4
su root
pkg install -y sudo
visudo
# uncommon `%wheel ALL=(ALL:ALL) NOPASSWD: ALL`
1
2
3
4
sudo pkg install -y qemu-guest-agent
sudo service qemu-guest-agent enable
sudo sysrc qemu_guest_agent_flags="-d -v -l /var/log/qemu-ga.log"
sudo service qemu-guest-agent start
1
2
3
4
sudo pkg install -y vim tmux curl git mtr
curl -sL key.nella17.tw | sh
curl -sL git.io/nella17-tmux-conf --output ~/.tmux.conf
curl -sL https://github.com/nella17/dotfiles/raw/main/.vimrc.simple --output ~/.vimrc

/etc/make.conf

1
2
3
MASTER_SITE_BACKUP?=    \
       http://FreeBSD.cs.nctu.edu.tw/distfiles/${DIST_SUBDIR}/
MASTER_SITE_OVERRIDE?=  ${MASTER_SITE_BACKUP}

HW1

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
echo "judge::20:::::/home/judge:/bin/sh:" | sudo adduser -G wheel -f -
sudo mkdir /home/judge/.ssh
curl -sL https://nasa.cs.nctu.edu.tw/sa/2022/nasakey.pub | sudo tee /home/judge/.ssh/authorized_keys
sudo ssh-keygen -l -f /home/judge/.ssh/authorized_keys

sudo pkg install -y wireguard
# /usr/local/etc/wireguard/wg0.conf
sudo chown root:wheel /usr/local/etc/wireguard/wg0.conf
sudo chmod 600 /usr/local/etc/wireguard/wg0.conf
sudo service wireguard enable
sudo sysrc wireguard_interfaces="wg0"
sudo service wireguard start
mtr 10.113.18.254
Built with Hugo
Theme Stack designed by Jimmy