forked from SA-AWS-DevOps-July24/Training_Documents
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdummy
More file actions
634 lines (332 loc) · 12.2 KB
/
dummy
File metadata and controls
634 lines (332 loc) · 12.2 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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
~~~~~~~~~~~~~~~~~~~~~~~
Day 2: 14th July 2024
~~~~~~~~~~~~~~~~~~~~~~~
Introduction to Cloud Platform
AWS Free Tier Account
Login to AWS Console
Create EC2 Instances(Virtual Machines)
Linux
On-premises Environments
Servers,Storage,Networking,Dbase
Software - Cost
Cloud Environments :::
Core Linux Administration :::
Linux Machine
Hypervisor & VMs - 16 GB of RAM 2CPU
Create AZURE / AWS - Account
Create VMs
Telecomm - SP1 -- Introduce a new service to their customers -> ASAP! IT Services
Build Servers/Test Servers/Deployment servers
SP2
AWS Free Tier Account -- https://aws.amazon.com/console/
Active Email_ID & Mobile Number
Active Credit/Debit Card - enabled with International Trancsaction
12 Months free tier account -
Login to AWS Console
Create EC2 Instances(Virtual Machines)
Linux
AWS Account Creation Process!
https://aws.amazon.com/console/
Login to AWS Console :::
- Login as a root user (Using Email_ID & Password) # Default
(or)
- IAM User # Not Now!
In AWS Cloud platform :::
Regions (Locations)
Availability Zones (Data Centers)
Upon Login to AWS Console
- Choose set AWS Region.
- Create the resources within that regions
Billing Management :::
Free Tier ::
Create EC2 Instances(Virtual Machines) :::
Select EC2 Service
From EC2 Dashboard - Select Launch Instance
How to Access the remote service?
www.gmail.com
- Web Browser
- Authentication - UserName & Password
AWS Platform
EC2 Instance (Virtual Machine)
- SSH Connection Protocol
- Authentication Types :
- Password Based Authentication
- Token Based Authentication
- Key Based Authentication
- Public key and private key
- Passwordless Authentication
1 VM == 750 Hrs/Month
10 VMs == 75 Hrs/Month
It is always recommended to STOP the EC2 Instance if it is not in use!
AMI
Choose : Ubuntu v22.04 LTS AMI
Windows
Linux
Mac
Linux based AMI :::
Linux Open-Source Operating System :
UNIX OS
- Linux Distribution
Package Manager (Used to Install/Uninstall/Upgrade the packages)
Debian/Ubuntu apt-get / apt
Centos/RHEL yum
Fedora dnf
Previous version of Fedora uses yum package manager
Window OS -->
- Windows Installer! -> Package Manager for Windows OS
- Used to Install/Uninstall/Upgrade the packages ad
Created the Instance :::
Running
Instance ID (Uniquely Generated)
Name/Tag (We assign)
Host Name :
Public IP Address (Will Change everytime we restart the Instance)
Private IP Address (Constant IP Address, exist till you terminate the Instance)
How to Connect to EC2 Instances :::
- Authentication Types :
- Password Based Authentication
- Token Based Authentication
- Key Based Authentication
- Public key and private key
- Passwordless Authentication
Host_Name
User_Name
Credentials
- EC2 Instance Connect (Thru Browser - AWS Console)
- SSH Agents : (Tool installed in the client machine to access Linux VMs)
MobaXterm - https://mobaxterm.mobatek.net/download.html
https://mobaxterm.mobatek.net/download-home-edition.html - Choose Installer Edition
Download *.zip
Extract & run the exec file
Open MobaXterm Tool
Select Session - Setting
- Remote Host :Public IP Address
- User Name : ubuntu
- Advanced Setting
- Choose Private key check box
- browse thru the *.pem from downloads folder
Putty
- Terminal : # Ubuntu/Mac Users
Create AWS Account
Login to AWS Console as a root
Goto EC2 Instance Dashboard
Create EC2 Instance
- Create Key Pair
Connect to EC2 Instance using EC2 Instance Connect (Thru Browser - AWS Console)
Fundamentals of Linux Operating System ::
Overview of Linux
Linux Architecture
Linux Distributions
Basic Linux Commands
File Permission Management
User Creation
Shell Scripts
SSH and VI Utility - Remote Server Access
Operating System ::
What is an Operating System ???
- Is an interface between the user application and the Hardware.
Windows
Linux
Mac
Android
High End computation Servers
- Reliable OS
- Linux Based OS
OS Architecture ::
Linux - Kernel is the core of Linux
Manage the Underlying Hardware, User Applications, External Resources,
It create the process
Each and every process runs in its own address space/volume
Dedicated/Isolated path
OS Kernel
Namespace
Control Group
Executed as Command Line Utilities
Traditional Linux are CUI (Command User Interface) Based
Windows are GUI (Graphical User Interface) based
Linux Distribution :::
AWS Cloud --> Ubuntu v22.04 ===> Azure --> Ubuntu v22.04
- Linux Distribution
Package Manager (Used to Install/Uninstall/Upgrade the packages)
Debian/Ubuntu apt-get / apt
Centos/RHEL yum
Fedora dnf
Previous version of Fedora uses yum package manager
All the package Manager should be executed as a root user.
Basic Linux Commands :::
sudo -i # To elevate the access to root level
hostname -i
clear
ls
pwd # present working directory
~~~~~~~~~~~~~~~~~~~~~~~
Day 3: 20th July 2024
~~~~~~~~~~~~~~~~~~~~~~~
Fundamentals of Linux Operating System ::
Overview of Linux
Linux Architecture
Linux Distributions
Basic Linux Commands
File Permission Management
User Creation
Shell Scripts
SSH and VI Utility - Remote Server Access
- Linux Distribution
Package Manager (Used to Install/Uninstall/Upgrade the packages)
Debian/Ubuntu apt-get / apt
Centos/RHEL yum
Fedora dnf
Previous version of Fedora uses yum package manager
Why we need Linux ???
Linux OS
Install and Manage all the DevOps Tools on Linux Machines
Open-Source DevOps Tools :
git,jenkins,docker,kubernetes/Prometheus/Grafana,ansible,terraform
What is your role here ???
1. Install the DevOps Tools
2. Manage the Tools -- Periodically Clean-up/Upgrade the tools
3. Remote access to the servers
Client - Server Architecture
Server
- Client1,2,3,4,5
4. DevOps Team can Administrate the Linux Machines
1. Package Management - install/uninstall/upgrade
2. File Management
3. User Management
4. Access Management
5. Remote Server Management
6. Process Automation
Working with Linux OS :
- Basic Linux Commands
clear
root user will have complete admin access to Linux Machine.
- Linux Distribution
Package Manager (Used to Install/Uninstall/Upgrade the packages)
Debian/Ubuntu apt-get / apt
Centos/RHEL yum
Fedora dnf
Previous version of Fedora uses yum package manager
1. Package Management - install/uninstall/upgrade
clear # Clean the Command
sudo -i # to elevate the access to root level
Used to execute package manager
apt update -y # used to update the default packages
git,maven,docker,jenkin,ansible
apt install git -y
git --version
apt install maven -y
apt install tree -y
apt install nginx -y
apt remove git -y
apt upgrade git -y
File related commands :::
2. File Management
Directory # Is folder - collections of files & sub-folders
- File Access Mode
- Read/Write/Execute
For any user in Linux, will have a home directory
pwd # show Present working directory
cd # Change Directory
cd / # Control will be take to the root directory at the system level
cd ~ # Control will be taken to the home directory of the user level
exit # Used to logout from a user
ls # Used to List the files and directories of the current path
echo # Used to print the message on terminal/Console
Create the files :::
1. echo "Hello Everyone" >> file1.txt # Create the file
echo "Session1" > file.txt
cat file1.txt # To print the content of the file
2. touch file2.txt # Used to create empty file
3. vi file3.txt # Create or edit a file using vi editor
Press i # goto insert mode
Type the file contents
Press ===> esc key
Type ===> :wq # Save and Exit from vi editor
Type ===> :q! # Exit from vi editor without saving the changes
ll # Long List
mkdir # Make / Create Directory
cd .. # go back to previous directory
Working with Directories ::::
Hidden Files/Directories -->
all the hidden files/directories will be prefixed with .
echo "rec1" >> .s1.txt # Create a hidden file
mkdir .dir2 # Create Hidden Directory
mv s1.txt payment.text # Rename a file
mv s2.txt subdir1/ # Move the file from one dir to another
cp s1.txt subdir1/ # Copy the file from one dir to another
rm -rf subdir1/ # Remove the folder
rm file1.txt # Remove the file
rm *.java # Remove Multiple files using wild-card symbol *
rm file1.txt file2.txt # Remove multiple files
What is Deployment ??
Copying the artifacts from one machine to another machine
Dev Server *.war
Test Server *.war
ll # Long List
First 1 character are used to identify the type of component and its access level
Project Folder -- Source Code & Program to execute
Owner
Group of Users
Public/Common User
User: Dev - Group: Development Team
drwxrwxr-x 2 ubuntu ubuntu 4096 Jul 20 06:35 dir1/
drwxrwxr-x
----------
- # Used to identify the type of component - file/directory
# Possibel values are ====> '-' and 'd'
--- # Owner : Possible values are rwx Read / Write / Execute
--- # User Group : Possible values are rwx Read / Write / Execute
--- # Possible values are rwx Read / Write / Execute
Eg.:
payment.java
-rwx------ # Owner of the file can have Read / Write / Execute access.
-rw------- # Owner of the file can have Read and Write access.
-rwxr----- # Owner of the file can have Read / Write / Execute access.
# User Group can just read the file
-rwxrw-r-- # Owner of the file can have Read / Write / Execute access.
# User Group can just read & Write the file
# Common user can just read the file content
chmod
https://chmod-calculator.com/
User Management :::
- How to create Users on linux Machine
- How to login to that user
- Setup the Access to that user
- Define ownership
DevOps :::
Create some Virtual Machines :::
server (VM)
Clients (VM) 1,2,3,4,5
Create : devopsadmin user
Remote Server :::
SSH Protocol :
Host Name
User Name
User Credentials
ls -a # Used to get the list of all components including hidden files and directories
Is SSH ::
By Default :
Key based authentication :::
Public Key
Private Key
Password based authentication :::
cd /etc # Directory maintains all the packages and system properties
cat /etc/passwd # Used to get the list of users
cat /etc/group # Used to get the list of user groups
user1
user2
dev_group
Install Docker -- Container Engine
docker group
devopsadmin
Group level Access
Create New Linux User :::
Excute these commands as a root user:
#useradd devuser1
useradd devuser2 -s /bin/bash -m -d /home/devuser2 # Create User
su - devuser2 # Login to that user
How to create password for Linux users
passwd <user_id>
passwd devuser2 # Create Password
New Password : # Is a Hidden field Enter valid password
Re-Type New Password : # Is a Hidden field re-type & confirm password