-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRhel7_Fundamentals
178 lines (118 loc) · 3.1 KB
/
Rhel7_Fundamentals
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
===shell & manajemen file & directory===
whoami → cek user aktiv
pwd → print working directory
cd → change directory
mkdir → make directory
rmdir → remove empty directory
ls → listing directory
[command] --help
man [command]
touch → membuat file kosong
rm → menghapus file/dir
cp → copy file/dir
mv → move/rename file/dir
file → melihat tipe file
===editor teks vi===
cat → menampilkan isi file teks
command vi
i → masuk ke mode edit
esc → kembali ke mode command
:w [namafile] → simpan file
:q! → keluar
:wq → simpan dan keluar
yy → copy 1 baris di posisi kursor
3yy → copy 3 baris mulai dari posisi kursor ke bawah
dd → delete/cut 1 baris di posisi kursor
3yy → delete/cut 3 baris mulai dari posisi kursor ke bawah
u → undo
:redo → redo
/[string] → mencari kata string
n → mencari kata string berikutnya
:%s/string_awal/string_pengganti/g
===manajemen disk===
1. membuat partisi disk → fdisk
# fdisk -l
# fdisk /dev/sdb
p → menampilkan skema partisi
g → create partition table gpt
n → membuat partisi baru
w → menyimpan skema partisi
q → keluar tanpa menyimpan
# partprobe → kernel membaca skema partisi baru
# fdisk -l
2. membuat file system → ext4, xfs
# mkfs.xfs -L DATA /dev/sdb1
3. mount → /etc/fstab
# mkdir /mnt/data → directory mount point
# vi /etc/fstab
/dev/sdb1 /mnt/data xfs defaults 0 0
# mount /dev/sdb1
# mount
# df -h
# umount /dev/sdb1
# df -h
===Manajemen Paket===
Repository → Database paket + index
Manajemen paket → yum
File konfigurasi repositori → /etc/yum.repos.d/*.repo
---Konfigurasi Repo ke DVD---
1. Buat direktori mount point DVD
# mkdir /media/cdrom
2. Mount DVD RHEL
# mount /dev/cdrom /media/cdrom
# df -h
3. Buat file konfigurasi repo
# cd /etc/yum.repos.d/
# vi rhel7-dvd.repo
[rhel7-dvd]
name=Red Hat Enterprise Linux 7 DVD
baseurl=file:///media/cdrom
enabled=1
gpgcheck=0
# yum repolist
# yum search nano
# yum install nano
# yum list | more
===Konfigurasi Jaringan===
1. Colok kabel UTP
# dmesg | grep enp
# nmtui
IP: 10.0.0.2x/24
Gateway: 10.0.0.1
DNS1: 8.8.8.8
DNS2: 8.8.4.4
[X] Automatically connected
# ip addr → Cek alamat IP
# ip route → Cek default gateway
# cat /etc/resolv.conf → Cek DNS resolver
# ping 10.0.0.2x
# ping 10.0.0.1
# ping 8.8.8.8
# ping 10.0.0.20
–-Test service network (httpd)---
# yum install httpd
# systemctl start httpd
# systemctl status httpd
# systemctl stop firewalld
# systemctl disable firewalld
# systemctl status firewalld
Browsing dari Host OS laptop ke RHEL Server
http://10.0.0.2x
===SSH Service===
# systemctl status sshd
Test SSH dari Hos OS laptop ke RHEL 7 Server
---SSH Tanpa Password (Key Public)---
---Generate Key Public di Host OS Laptop (Linux)---
$ ssh-keygen
$ ls -lh ~/.ssh/
---Copy Key Public ke server SSH di Host OS Laptop (Linux)---
$ ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
Test SSH dari Hos OS laptop ke RHEL 7 Server
---Transfer File lewat SCP---
SCP dari Host OS ke Server
scp -r /etc/passwd [email protected]:/root/
SSH ke Server
# ls -lh /root
SCP dari Server ke Host OS
scp -r [email protected]:/etc/redhat-release ~/
Utian