-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstallation - General
163 lines (117 loc) · 3.69 KB
/
Installation - General
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
## Arch Install for PogoPlug
# 1) Follow the instructions to get an install of Arch Linux ARM going on PogoPlug at https://archlinuxarm.org/platforms/armv5/pogoplug-v2-pinkgray
## Set up a SWAP partition on the HDD that you are going to have on this PogoPlug if possible
# Boot up in Arch Linux ARM after installation on the Pogoplug and get IP that was assigned to the PogoPlug through router or ping. Afterwards, SSH into PogoPlug, sign in with root first
###########
# General #
###########
## Set correct permissions on root folder
chown root:root /
## Set different hostname
hostnamectl set-hostname PogoPlug
## Set timezone
timedatectl set-timezone Europe/Brussels
## Create different user
useradd -m -G wheel -s /bin/bash pogoplug
passwd -l pogoplug
## Updates & installation of basic packages
pacman -Syu linux-kirkwood linux-kirkwood-headers ntp base-devel nano wget rsync git unzip
## Enable NTP for time synchronization
systemctl enable ntpd
systemctl start ntpd
## Generate new SSH keys
rm /etc/ssh/ssh_host*
ssh-keygen -A
## Change locale
nano /etc/locale.gen
# Uncomment en_US.UTF-8 UTF-8
locale-gen
nano /etc/locale.conf
LANG=en_US.UTF-8
## Set up SWAP partition
# Identify SWAP partition that you made earlier on the USB drive, probably /dev/sda2
mkswap /dev/sda2
swapon /dev/sda2
# Get UUID of swap partition
blkid /dev/sda2
# Set SWAP on boot
nano /etc/fstab
UUID=<SWAP UUID HERE> none swap defaults 0 0
## Set up sudo
EDITOR=nano visudo
pogoplug ALL=(ALL) ALL
## Set up folders
mkdir /home/pogoplug/Movies
mkdir /home/pogoplug/TVShows
mkdir /home/pogoplug/Downloads
mkdir /home/pogoplug/Downloads/incomplete
mkdir /home/pogoplug/Downloads/complete
mkdir /home/pogoplug/Downloads/complete/movies
mkdir /home/pogoplug/Downloads/complete/tvshows
####################
# Set up Static IP #
####################
## Networking is done through systemd-networkd
nano /etc/systemd/network/eth0.service
[Match]
Name=eth0
[Network]
Address=192.168.0.11/24
Gateway=192.168.0.1
############
# Security #
############
## Restrict root login
passwd -l root
## Restrict SSH
nano /etc/ssh/sshd_config
PermitRootLogin no
## Restricting access to kernel logs
nano /etc/sysctl.d/50-dmesg-restrict.conf
kernel.dmesg_restrict = 1
## Restricting access to kernel pointers in the proc filesystem
nano /etc/sysctl.d/50-kptr-restrict.conf
kernel.kptr_restrict = 1
## Firewall
pacman -Syu ufw
ufw default deny
ufw allow to any port 22 proto tcp
ufw enable
systemctl enable ufw
systemctl start ufw
################
# Samba Server #
################
## Install Samba
pacman -Syu samba
## Move smb.conf to /etc/samba/
## Create SMB password
smbpasswd -a pogoplug
## Start samba
systemctl enable smbd nbmd
systemctl start smbd nbmd
############################
# Mount SMB server at boot #
############################
# First, test out mounts with sudo mount -t cifs //<IPADDRESS>/<FOLDER> TVShows/ -o user=<USERNAME>,password=<PASSWORD>
# Change /etc/fstab for permanent mounting
nano /etc/fstab
##############
# Autoupdate #
##############
## Move autoupdate.sh to /home/pogoplug/applications/autoupdate
## Move autoupdate.service & autoupdate.timer to /etc/systemd/system/
systemctl enable autoupdate.timer
systemctl start autoupdate.timer
###########
# DuckDNS #
###########
## Move duckdns.sh to /home/pogoplug/applications/duckdns/
## Move duckdns.service & duckdns.timer to /etc/systemd/system/
systemctl enable duckdns.timer
systemctl start duckdns.timer
#########################
# Failure Notifications #
#########################
## Move failure-notification.sh to /home/pogoplug/applications/
## Move unit-failure-notification@.service to /etc/systemd/system/