-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNOTES.txt
96 lines (81 loc) · 2.78 KB
/
NOTES.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Host stuff
==========
apt install qemu-kvm qemu-system-x86 qemu-utils vde2
wget https://dl-cdn.alpinelinux.org/alpine/v3.16/releases/x86_64/alpine-standard-3.16.0-x86_64.iso
qemu-img create -f qcow2 alpine.img 4G
# -spice enables the virt manager remote desktop thing
# -vnc enables vnc
# -curses used to work, but it boots in graphical mode for some reason
# pass nofb nomodeset to kernel parameters to get it working
# ...but then the keyboard layout is broken; nomodeset + qemu's window is the best option thus far
qemu-system-x86_64 -machine 'q35,accel=kvm' -accel kvm -boot order=dc -m 1G -hda alpine.img -cdrom alpine-standard-3.16.0-x86_64.iso
qemu-system-x86_64 -machine 'q35,accel=kvm' -accel kvm -boot order=c -m 1G -hda alpine.img
# note, re-enable password login in /etc/ssh/sshd_config ; or, you know, visually copy paste the key from one machine to another
# or use virt-mgr and spice, whatever.
qemu-system-x86_64 -machine 'q35,accel=kvm' -accel kvm -boot order=c -m 1G -hda alpine.img -net nic -net user,hostfwd=tcp::10022-:22
ctrl-alt-- and ctrl-alt-+ to shrink/grow screen
Guest
=====
login with root
ro
ro-std
ftpsync
[enter until you get to new password]
alpine
[continent]/[country]
[enter for whatever this question was]
f
alpine
[enter]
[password]
none
openssh
sda
sys
y
reboot
After reboot
------------
su
sed -i /etc/apk/repositories -e '/3\.16\/community/s/# //'
apk add python3 openssh-server pure-ftpd bash openrc pure-ftpd-openrc git py-dateutil
rc-update add pure-ftpd
sed -i /etc/pure-ftpd.conf -e '/ChrootEveryone/s/yes/no/'
sed -i /etc/pure-ftpd.conf -e '/NoAnonymous/s/no/yes/'
sed -i /etc/pure-ftpd.conf -e '/UnixAuthentication/s/# //'
sed -i /etc/pure-ftpd.conf -e '/UnixAuthentication/s/no/yes/'
sed -i /etc/conf.d/pure-ftpd -e '/IS_CONFIGURED/c\
IS_CONFIGURED=yes\
.'
sed -i /etc/conf.d/pure-ftpc -e '/MISC_OTHERS/c\
MISC_OTHERS="-E -j"\
.'
install -d -m 755 -o alpine -g alpine /home/alpine
install -d -m 700 -o alpine -g alpine /home/alpine/.ssh
rc-service pure-ftpd start
sed -i /etc/ssh/sshd_config -e '/PasswordAuthentication/c\
PasswordAuthentication no\
.
/KbdInteractiveAuthentication/c\
KbdInteractiveAuthentication no\
.'
rc-service sshd restart
cd /root
git clone https://github.com/curl/curl.git
cd /root/curl
apk add autoconf make gcc automake libssh2 libtool musl-dev libssh2-dev
autoreconf -fi
./configure --with-openssl --with-libssh2
make
make install
# ^D no more root
# note: rsa doesn't seem to be allowed by default nowadays
# make sure to add passphrase
ssh-keygen -t ed25519
ssh-keygen -p -f ~/.ssh/id_ed25519.pub
# don't have /etc/ssh/ssh_config AddKeysToAgent set to a time limit
cat ~/.ssh/id_ed25519.pub > ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
clone the repo in /home/alpine/FTPSync
cd ~/FTPSync/vm
./run_tests.sh