-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrpi-init.sh
More file actions
43 lines (31 loc) · 1.19 KB
/
Copy pathrpi-init.sh
File metadata and controls
43 lines (31 loc) · 1.19 KB
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
#/bin/bash
set -e
echo "=================================================="
echo "========== init update ==========================="
echo "=================================================="
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
sudo apt install vim pppoeconf ntpdate
echo "=================================================="
echo "========== download file ========================="
echo "=================================================="
set -x
curl https://raw.githubusercontent.com/SecondDim/script/main/.bash_aliases > ~/.bash_aliases
set +x
echo "=================================================="
echo "========== set ntp && time zone =================="
echo "=================================================="
sudo ntpdate tick.stdtime.gov.tw
sudo timedatectl set-timezone Asia/Taipei
date
echo "=================================================="
echo "========== set ssh ==============================="
echo "=================================================="
mkdir ~/.ssh && cd ~/.ssh
touch authorized_keys
chmod 600 authorized_keys
cd ~
# do it at localhost
# ssh-keygen -t ecdsa -b 521 -f rpi
# cpoy rpi.pub into authorized_keys
# if need
# sudo raspi-config