i think this fixes i3 issues
[distro-setup] / bitfolk-rescue-init
1 #!/bin/bash
2 # I, Ian Kelling, follow the GNU license recommendations at
3 # https://www.gnu.org/licenses/license-recommendations.en.html. They
4 # recommend that small programs, < 300 lines, be licensed under the
5 # Apache License 2.0. This file contains or is part of one or more small
6 # programs. If a small program grows beyond 300 lines, I plan to switch
7 # its license to GPL.
8
9 # Copyright 2024 Ian Kelling
10
11 # Licensed under the Apache License, Version 2.0 (the "License");
12 # you may not use this file except in compliance with the License.
13 # You may obtain a copy of the License at
14
15 # http://www.apache.org/licenses/LICENSE-2.0
16
17 # Unless required by applicable law or agreed to in writing, software
18 # distributed under the License is distributed on an "AS IS" BASIS,
19 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 # See the License for the specific language governing permissions and
21 # limitations under the License.
22
23
24 # meant to be copy/pasted
25
26 ssh bk@bk.console.bitfolk.com
27 # or
28 ssh iankelling@iankelling.console.bitfolk.com
29
30 destroy
31 rescue
32
33 sudo -i
34 mkdir -p /root/.ssh
35 chmod 700 /root/.ssh
36 cat >/root/.ssh/authorized_keys <<'EOF'
37 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDX42yru/h6r6UDRy/VwVZjcYEmNLG5/SUjv7xwu43OaW0wL+uHYg2rkfn4Ygh5o1I5pgBh2SWg8TeWuVGhgL1SCuBzzeai/+58Sny065Qak+D2WjVOuRonRelh+CBA5EpNZPuiWQkoWdf9NACTBCbS2Zu7r8OOgRqu/ruaDNePlG5+U0Wlpy3oBnpbzQiuSA3AKMW30fsCJtOBjz5qQaiPbYEKJy3AOvtbq10wliKx9TpsTzrq8dKWs7PLhZnzqVCsaq6D95IzjqXcSpx4Cga5bn+YEuAnJQ53PGA5eO+hpz6HDmawTbJlaV/Dufb9bJ/ZZy1DXzs07yWRtTEY54/X ian@iankelling.org
38 EOF
39
40 apt update
41 if [[ -e /usr/sbin/sshd ]]; then
42 systemctl restart ssh
43 else
44 apt -y install openssh-server
45 fi
46
47
48 ##### in another terminal ######
49
50 h=bk
51
52 scp -pr --chown=root:root /p/c/machine_specific/$h/filesystem/etc/ssh/ root@$h.b8.nz:/etc/ssh
53
54 scp /b/ds/bitfolk* root@$h.b8.nz:
55
56 # initially saved via:
57 # mkc /p/c/machine_specific/$h/filesystem/etc/ssh/
58 # rsync -a root@$h:/etc/ssh/ssh_host* .
59 ssh root@$h ./bitfolk-rescue-install $h
60
61 ### back to the 1st terminal
62
63 boot
64
65 # after boot, press ctrl ]
66 exit
67
68 h=bk
69 ${h}push
70 sl root@$h /a/bin/ds/distro-begin
71
72 sl $h /a/bin/ds/dall