-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
295 lines (231 loc) · 8.18 KB
/
Copy pathinstall
File metadata and controls
295 lines (231 loc) · 8.18 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
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
Pre-installation
#download arch linux iso
#Verify signature
gpg --keyserver pgp.mit.edu --keyserver-options auto-key-retrieve --verify archlinux-version-x86_64.iso.sig
#Create UEFI bootable USB {lsblk see where your usb sdb or sdc}
wipefs --all /dev/sdx
dd bs=4M if=path/to/archlinux.iso of=/dev/sdx status=progress oflag=sync
#Boot to live environment
#Set the keyboard layout
loadkeys us
#Verify the boot mode UEFI
ls /sys/firmware/efi/efivars
#Connect to the Internet
wifi-menu
ping -c 5 8.8.8.8
#Update the system clock
timedatectl set-ntp true
timedatectl set-timezone Asia/Jakarta
#layout partition disks :
Number Start (sector) End (sector) Size Code Name
1 2048 1050623 512.0 MiB EF00 EFI System
2 1050624 839911423 400.0 GiB 8300 Linux filesystem
#Delete all partitions on disk this will delete all data on your hardisk be carefull
gdisk /dev/sda
o = blank gpt
y = yes
w = write
#setup partition
gdisk /dev/sda
#create EFI System partitions
n
1
2048
1050623
EF00
#Create Linux filesystem
n
2
1050624
839911423
8300
w
y
#Encrypt System partition root and swap
cryptsetup --user-random luksFormat --cipher aes-xts-plain64 -h sha512 -s 512 --type luks2 /dev/sda2
cryptsetup open /dev/sda2 encrypt
pvcreate /dev/mapper/encrypt
vgcreate ArchLvm /dev/mapper/encrypt
lvcreate -L +8G ArchLvm -n swap
lvcreate -l +100%FREE ArchLvm -n root
#Create filesystems for efi, boot, root and swap
mkfs.vfat -F 32 /dev/sda1
mkfs.ext4 /dev/ArchLvm/root
mkswap /dev/ArchLvm/swap
#Mount for install ArchLinux
mount /dev/ArchLvm/root /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
swapon /dev/ArchLvm/swap
#install Arch linux system (i'm using laptop with broadcom wireless card and intel cpu)
pacstrap /mnt base base-devel dialog wpa_supplicant zsh linux-headers broadcom-wl-dkms git wget reflector intel-ucode
#generate partition table fstab
gefstab -U /mnt > /mnt/etc/fstab
#enter chroot
arch-chroot /mnt /bin/bash
#Set time zone and sync clock
ln -sf /usr/share/zoneinfo/Asia/Jakarta /etc/localtime
hwclock --systohc --utc
#set locale
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
echo "LANG=en_us.UTF-8" > /etc/locale.conf
locale-gen
#set keymap
echo "KEYMAP=us" > /etc/vconsole.conf
#set hostname
echo "archlinux" > /etc/hostname
#set hosts
echo "127.0.0.1 localhost\n127.0.0.1 archlinux.localdomain archilinux" > /etc/hosts
#Set root Password
passwd
#create user with sudo access
## Uncomment to allow members of group wheel to execute any command
sed -i '/%wheel ALL=(ALL) ALL/s/^#//' /etc/sudoers
useradd -m -g wheel -s /usr/bin/zsh userarch
passwd userarch
#set HOOKS initramfs
nano /etc/mkinitcpio.conf
HOOKS="base systemd udev autodetect keyboard sd-vconsole modconf block sd-encrypt sd-lvm2 filesystems fsck"
#Generate initrd image:
mkinitcpio -P
#install Bootloader systemdboot
bootctl install
#add entries loader
nano /boot/loader/entries/arch.conf
title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options rd.luks.name=
#exit save ctrl+x+y+enter
#we need get UUID sda2 encrypt
blkid -s UUID -o value /dev/sda2 encrypt >> /boot/loader/entries/arch.conf
#edit entries loader
nano /boot/loader/entries/arch.conf
title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options rd.luks.name=xxxxxxxx-xxxxxxxx-xxxx-xxxxxxxxxxx=cryptlvm root=/dev/ArchLvm/root rw ipv6.disable=1 net.ifnames=0 biosdevname=0
#exit save ctrl+x+y+enter
#exit chroot
exit
umount -R /mnt
swapoff -a
reboot
############################ Setup system boot to new system ############################
#will ask password for encrypt luks
#login as userarch
#connect to internet
sudo wifi-menu
#if u forgot ssid profile
ls /etc/netctl
#auto connect next boot
sudo netctl enable wlan0-ssid
sudo netctl start wlan0-ssid
#speedup mirrorlist
sudo reflector --score 100 --fastest 25 --sort rate --save /etc/pacman.d/mirrorlist --verbose
#Enable multilib if you need, uncomment the [multilib] section in /etc/pacman.conf
sudo nano /etc/pacman.conf
[multilib]
Include = /etc/pacman.d/mirrorlist
#refresh db multilib
sudo pacman -Syu
#install yay
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
#install all my setup Awesome + lightdm
wget https://raw.githubusercontent.com/clisys/Arch-Linux-systemd-boot/master/pkglist.txt
wget https://raw.githubusercontent.com/clisys/Arch-Linux-systemd-boot/master/aurpkglist.txt
sudo pacman -S --needed $(comm -12 <(pacman -Slq|sort) <(sort pkglist.txt) )
yay S --noedit --noconfirm --needed aurpkglist.txt
#Setup lightdm for awesome xsessions
sudo nano /etc/lightdm/lightdm.conf
[LightDM]
run-directory=/run/lightdm
sessions-directory=/usr/share/xsessions
[Seat:*]
greeter-session=lightdm-mini-greeter
greeter-allow-guest=false
session-wrapper=/etc/lightdm/Xsession
#add user to mini-greeter
sudo nano /etc/lightdm/lightdm-mini-greeter.conf
user = userarch
#enable lightdm to next boot
sudo systemctl enable lightdm.service
#Dotfile Setup
git clone https://github.com/clisys/Arch-Linux-systemd-boot.git
cd Arch-Linux-systemd-boot
mv .* ~/
chmod +x screenshot && sudo mv screenshot /usr/local/bin
sudo mv etc/X11/xorg.conf.d/30-touchpad.conf /etc/X11/xorg.conf.d/
#allow the MPD user to use PulseAudio
sudo nano /etc/pulse/client.conf
change the autospawn option to yes
#Enable mpd service
systemctl --user enable mpd.service
#allow user to shutdown add alias to /etc/sudoers
sudo nano /etc/sudoers
userarch archlinux =NOPASSWD: /usr/bin/systemctl poweroff,/usr/bin/systemctl halt,/usr/bin/systemctl reboot
#This config is especially add to /etc/sudoers :
Defaults !requiretty, !tty_tickets, !umask
Defaults visiblepw, path_info, insults, lecture=always
Defaults loglinelen=0, logfile =/var/log/sudo.log, log_year, log_host, syslog=auth
Defaults passwd_tries=3, passwd_timeout=1
Defaults env_reset, always_set_home, set_home, set_logname
Defaults !env_editor, editor="/usr/bin/vim:/usr/bin/vi:/usr/bin/nano"
Defaults timestamp_timeout=15
Defaults passprompt="[sudo] password for %u: "
Defaults lecture=never
#enable tlp apparmor service
sudo systemctl enable tlp.service
sudo systemctl enable tlp-sleep.service
sudo systemctl mask systemd-rfkill.service
sudo systemctl mask systemd-rfkill.socket
sudo systemctl enable apparmor.service
#enable AppArmor as default security model on every boot set the following kernel parameters:
nano /boot/loader/entries/arch.conf
apparmor=1 security=apparmor
#Setup Uncomplicated Firewall
sudo ufw status verbose
sudo ufw disable
#and set the default rules to deny incoming and allow outgoing connections;
sudo ufw default deny incoming
sudo ufw default allow outgoing
#Disable remote ping
sudo nano /etc/ufw/before.rules
# ok icmp codes for INPUT
-A ufw-before-input -p icmp --icmp-type destination-unreachable -j DROP
-A ufw-before-input -p icmp --icmp-type time-exceeded -j DROP
-A ufw-before-input -p icmp --icmp-type parameter-problem -j DROP
-A ufw-before-input -p icmp --icmp-type echo-request -j DROP
#Disable UFW logging
ufw logging off
#Enable Ufw
sudo ufw enable
#setup dnscrypt-proxy
sudo nano /etc/dnscrypt-proxy/dnscrypt-proxy.toml
listen_addresses = ['127.0.0.1:53']
#setup resolv.conf
sudo nano /etc/resolv.conf
nameserver 127.0.0.1
#make resolv.conf unchangeable by anyone on your system
sudo chattr +i /etc/resolv.conf
#enable dnscrypt-proxy
sudo systemctl enable dnscrypt-proxy
#reboot
sudo systemctl reboot
#boot to Arch linux With lightdm and awesome wm
#open terminal super+enter
#open file manager super+/
#open browser super+i
#for download mp3
Super+enter
cd Music
dlmp3 https://www.youtube.com/watch?v=Jpfevl5k7k4
#Show all command Super+s
#show all alias super+enter type alias {dlmp3 is my custom alias, musix for play ncmpcpp}
#poweroff open rofi
Super+p
type poweroff