forked from srinivas1987devops/myweb
-
Notifications
You must be signed in to change notification settings - Fork 4
/
madan-linux.txt
1470 lines (765 loc) · 32 KB
/
madan-linux.txt
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
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
How to create AWS account ???
email address , mobile number , Debit card ( master / visa )
Google ===>> aws console login ==>> AWs management console ===>> sign into console ==>>> create new account ==>> email : xyz , password 1243 , conform password : 1234 ==>> Aws account name : ==>> continue..
AWS free-tier ( select ) ===>> personal ( select ) or proffesional/ business acount ===>>> address details ==> d.no , streect , pincode , state ,near landmark..
==>>> debit card details ==>> 16 digits number ==>> CVV ===>>> OTP ( 2/-) ===>>> do you have pancrad : no ===>>
AWS ==> verification ==>> mobile number ===>> voice message / text message (select) ==>> 4 digits ( 5896 )
my role is : student
you are intestrd in : other..
AWs console login ==>> sign in ==>> email id with password ===>>
AWS account ==>> imediate / 24 hours..
=========================================================================================================
Linux servers : we will create linux servers in AWS account
Linux servers to connect ===>> we need to two softwares or applications install in our laptop.
1. gitbash
2. putty
=========================================================================================================================
Linux : it is an operating system like windows..
Linux is process oriented operating system..
Datacenter : physical linux servers ===>> hardware ===>> o.s install ( linux ) ===>> application and databse installl ==>> APP ===>> EU.
AWS ==>> Cloud ===>>> AMI ( amazon machine image) ==>> Ec2 instance ==>>> application and databse installl ==>> APP ===>> EU.
Unix : operating system.
Unix 4 types of flavours :
1. sun solaris 2. Redhat Linux ( open source and free of cost ) 3. IBM-AIX 4. HP-UNIX..
Other remaining these three are enterpraise versions ===>> License purhase ===>>>> manadatory..
windows :
C:/ : operating system install ===>> Admin user.
GUI mode operations ( Graphical user interface) ===>> clicks.
files and folders
NTFS filesystem ( new technology file system)
Linux :
/ ==>>> root ===>>> operating system install ===>>> rootuser / parent user / super user / Admin user.
CLI mode operations : ( Command Line interface) ===>>> commands to type.
files and directories
ext2 , ext3 , ext4 ( latest ) ==>> file systems.
ext2 ===>> second extended file system.
ext3 ===>> third extended file system.
ext4 ===>> fourth extended file system.
=====================================================================================================================================
ec2 : elastic cloud compute : ec2 ==>>> virtal machine. ==>>> ec2 instance.
AMI ==>> Amazon machine image
Every AMI has their own identification number ===>> AMI ID.
Every operarting sysrem has their own AMI. ==>> o.s install.
security group :
It is a virtual firewall at ec2 instance level..
it contains set of rules..
every application has their own port number..
all ports in between ==>>> 0 to 65535
ec2-user ( default user ) ===>> able to login we need to add a rule ==>> ssh ( mandatory)
ssh ==>> port number ==>>> 22.
http ==>> port number ==>> 80
mysql ==>>> database ==>> 3306
==============================================================================================
when ever you created a ec2 intsance ==>> then automatically two Ip addresses will come.
1. public IP address : ec2 instance to login and application enduser to access.
this is visible only in AWs console dashboard.
2. private Ip address : it is used to internal communication.
this is visible in both AWS console dashboard and ec2 instance.
==================================================================================================
keypair ===>>> ramakrishna ===>> download ===>>> extension ====>>> ramakrishna.pem ==>> pemfile.
pemfile conatins privatekey
afetr launching the ec2 instance ===>> defaultly create publickey key .
privatekey and publickey -->>> match --->>> default user able to login into ec2 instance ( ec2-user).
=====================================================================================================
=======================================================================================================
Linux basic commands :
Files and directory operations :
Files operations :
cat > filename
I am new to linux ..
ctrl + d ==> save.
ex: cat > ramakrishna
I am new to linux , devops , aws
ctrl + d ==>> save..
==>>>> list of files ==>> ls
file identification ==>> ls ==> file ==>>> white color.
ls -l ==>> first field ==>> - ( hyphen)
2. How to append the data ina file
cat >> filename
S3 and RDS ..
ctrl + d ==>> save
3. How to view inside data in a file.
cat filename
cat ramakrishna
4. How to copy file from one location to another location.
cp source destionation
note : destination must be a directory..
mkdir directoryname
mkdir sachin
ex: cp ramakrishna sachin
4. How to move file from one location to another location.
mv source destionation
note : destination must be a directory..
mkdir directoryname
mkdir yuvi
ex: mv ramakrishna yuvi
5. How to rename a file.
mv oldname newname
mv ramakrishna srinivas
6. How to create empty files.
touch filename
touch abc
touch {a..m}
7. file1 ==>>>data and file2 empty file ==>> file1 data copy to file2. ==>>> redirect.
cat file1 > file2
cat ramakrishna > abc
8. How to delete a file .
rm -rf filename
rm -rf ramakrishna.
====================================================================================
====================================================================================
directory operations :
how to create a directory ??
mkdir directoryname
mkdir sachin
ls ==>> directory color ==>> blue.
ls -l ==>> first field ( d)
pwd ==>> present working directory..
cd ==>> change directory..
cd sachin
pwd
/home/ec2-user/sachin
mkdir rahul
cd rahul
pwd
/home/ec2-user/sachin/rahul
mkdir hardik
cd hardik
pwd
/home/ec2-user/sachin/rahul/hardik
mkdir lara
cd lara
pwd
/home/ec2-user/sachin/rahul/hardik/lara
cd ..
/home/ec2-user/sachin/rahul/hardik
cd ..
/home/ec2-user/sachin/rahul
cd ..
/home/ec2-user/sachin/
cd ..
/home/ec2-user/
mkdir -p /home/ec2-user/sachin/rahul/hardik/lara/ponting
cd /home/ec2-user/sachin/rahul/hardik/lara
pwd
/home/ec2-user/sachin/rahul/hardik/lara
cd ../../../../
pwd
/home/ec2-user/
================================
how to rename a directory
mv oldname newname
mv sachin dhoni
how to delete a directory
rm -rf directryname
rm -rf sachin
=================================================================================================
filter commands :
files / directories / users / groups
useradd ramakrishna
useradd bhargavi
user related information ==>>> /etc/passwd
head : top 10 users to display ==>> head /etc/passwd
tail : below 10 users to display ==>> tail /etc/passwd
more : page by page ===>> more /etc/passwd ==>>> space button press ==>> last page ==>> automatically exit..
less : page by page ==>> less /etc/passwd. ==>>> space button press ==>> last page ==>> not exit ==>>> q button press ==> quit
==================================================================================================
vi editor :
files ===>>> create , with in the files ==>> data ==>>> modify and delete by using vi editor..
vi editor has 3 types of modes..
1. CLI mode.
2. Insert mode.
3. Extended mode.
vi ramakrisha ====>> CLI mode
press " i " key ==>> insert mode.
I am new to Linux..
escape shift:wq! ===>>> save ===>>> extended mode.
cat ramakrishna
=================================================================================================================
grep and find :
10 files
ramakrishna
ls -l | grep ramkrishna
ls -l | grep 123
ls -l | grep abc
ls -l | grep a
ls -l | grep A
i ==>> ignore case sensitive
ls -l | grep -i A
find :
find / -optins keyword
options :
1. files
2. directories
3. users
4. groups
5. inum ==>>> inode number ==>> 4 digit number.
find / -name ramakrishna
find / -name sachin
find / -user pavan
find / -group aws
find / -inum 1234
=================================================================
files and directory permissions : ===>> security
security ===>> userlevel , grouplevel , otherlevel..
ls -l
- ==>> file
d ==>> directory
c ==>> charecter file
b ==>> block file
l ==>> link file.
rw- ( userlevel) r-- (grouplevel ) r-- ( otherslevel)
r ==>>> read ===>> 4
w ==>> write ===>> 2
x ==>> execute ==>> 1
By using this command ==>> chmod command ==>> change modification.
2 types methods to giving the files and directory permissions.
1. symbolic method.
2. Absolute method.
=======================
1. symbolic method.
file ==>>> bhargavi
userlevel 6 , grouplevel 3 , otherslevel ==>> 5
chmod u=rw,g=wx,o=rx bhargavi
sachin ==>>> 7 ( userlevel ) 6 ( group level ) 4 ( otherlevel )
chmod u=rwx,g=rw,o=r sachin
=========================================================
2. Absolute method.
yuvi ==>> 655
chmod 655 yuvi
chiru ==>> 666
chmod 666 chiru
abc ==>> only userlevel full permissions..
chmod 700 abc
xyz ==>> group level full permissions..
chmod 070 xyz
chmod 007 ponting..
========================================================================
file full permissions : 666
directory full permissions : 777
default file permissions : 644
default directory permissions : 755
umask ==>> 022 / 0022
666 - 022 ==>> 644
777 - 022 ==>> 755
========================================================================
Booting process :
ex: windows ==>> power on button ==>> press ==>> password ====>> in between poweron button and passowrd process ==>> Booting process..
Linux ==> power on button ==>> press then booting process will starts.
Booting process has 6 stages :
1. BIOS : Basic input output system.
2. MBR : Master boot record.
3. GRUB : Grand unified bootloader.
4. KERNEL :
5.INIT : initialization.
6. RUNLEVELS :
1. BIOS : Basic input out system.
It will checks the system integrity check .
system integrity check ==>> system's hradware check ==>> motherboard , cpu , ram , harddisk ==>> properly working or not ??
2. MBR : Master boot record:
It contains the bootables files ..
MBR has 3 components
1. Primary bootloader. ==>> 446 bytes.
2. Partition table information. ==>> 64 bytes.
3. MBR validation check. ==>> 2 bytes.
MBR size ==>> 512 bytes.
3. GRUB : Grand unified bootloader.
GRUB contains the information
Root device inforamtion ===>> /dev/xvda
multiple kernel images ==>> 5 , 6 , 7 , 8 , 9
default time ===>> ???
timedout ===>> ???
grub contains one configuration file ===>> /boot/grub/grub.conf
vi /boot/grub/grub.conf
/boot/grub/grub.conf ==>>> this configuration file link to /etc/grub.conf.
4. KERNEL :
It is the mediator between o.s and hardware.
it is the heart of the operating.
It will manages devices information , multitasking , filesystem information.
5. INIT :
It is parent of all process.
each process has their own unique identification number.
process ==>> unique id ==>> process id ==>>> PID
init ==>> pid ==>> 1
root ==>> pid ==>> 0
init 0 ===>> Hung state. ( danger command.)
init 1 ===>> single user mode ( trouble shoot )
init 2 ===>> multiuser mode with out network ( networking related commands are not working)
init 3 ===>> multiuser mode with network ( networking related commands are working here) ==>> default init level
init 4 ===>> un used.
init 5 ==>>> X11 ( GUI mode )
init 6 ===>>> reboot ==>> danger command ===>> with respective people ==>> approval.
vi /etc/inittab
/etc/init.d ==>> scripts..
6. RUNLEVELS :
shell scripts ==>>> application install or backup ==>> scripts to put inside inside runlevels.
/etc/rc.d/rc0.d ==>> runlevel 0
/etc/rc.d/rc1.d ==>> runlevel 1
/etc/rc.d/rc2.d ==>> runlevel 2
/etc/rc.d/rc3.d ==>> runlevel 3 ==>>> default runlevel..
/etc/rc.d/rc4.d ==>> runlevel 4
/etc/rc.d/rc5.d ==>> runlevel 5
/etc/rc.d/rc6.d ==>> runlevel 6
vi /etc/rc.d/rc3.d/.backup.sh ==>> reboot ==>> you will get complete backup of linux server.
/etc/init.d ==>> scripts.. ==>>> app ==>> service ==>> manage.
=============================================================================================
AWS ==>> runlevels ==>> alternative ==>> userdata ==>> script.
==================================================================================================
Partitiong / filesystem creation :
deviding the hard disk into the no .of partitions..
500gb harddsik ===>> 10 parttions ==>> each partition has the size ==>> 50 gb..
Physical servers point of view :
device naming convensions :
/dev ==>> devices information.
/dev/sda ==>> SCSI
/dev/hda ==>> IDE
/dev/vda ==>> virtual disk..
4 , 8 , 12 , 16.
Each physical linux servers ==>> 16 hard disks attached one linux servers..
/dev/sda to /dev/sdp
/dev/sda to /dev/sde ==>>>> o.s internally used..
extranal we will attached to the physical linux server ==>>> /dev/sdf to /dev/sdp..
LInux ==>> file system types ==>> ext2 , ext3 , ext4 ( latest )
senario :
Application team ==>> request raise to linux admin team ==>> 500 gb ==>> disk space ( hard disk) ==>>>file sysyem ==>> app5 ==>> mount point ==>> application install.
Linux admin team ==>> request raise SAN ( storage area network ) team ==>> please attach 500 gb hard disk to lx123 ( linux server name ).
SAN team request raise to data center people ( field engineers ) ==>>> lax123 ==>attach to 500gb hard disk. ==>>> they will attach 500gb hard disk to linux server.
Linux admin team follows below steps..
1. fdisk -l ( o.s control )
2. partprobe /dev/sdf ==>>> kernel identification.
3. mkfs.ext4 /dev/sdf ==>> creating the file system.
4. mkdir app5
5. mounting : attaching a directory to the file system. it is called mount point.
mount -t ext4 /dev/sdf app5
6. cat /etc/mtab ==>> temparary mount points.
7. How to make permanate mount ??
vi /etc/fstab
devicename mountpoint typeoffilesystem defaults 0 (dump) 0 ( check sequence)
/dev/sdf /home/ec2-user/app5 ext4 defaults 0 0
esc shift:wq!
8. cd app5
ls
lost + found ==>> directory..
touch {a..e}
reboot
===============================================================================
AWS cloud : EBS ==>> elastic block storage.
disk space ===>> volume
Application team ==>> request raise to linux admin team ==>> 500 gb ==>> volume ==>>> filesystem ==>>> app5 ==>> mount point ==>> application install.
EBS thumbrule :
Ec2 instance and volume should be in same availability zone.
Ec2 instance ==>> 1a ==>> AZ
volume ==>> same AZ ( 1a ) ==> 500 gb
we will attach this volume to ec2 instance
volumes ==>> 16 volumes to create one ec2 instance.
/dev/sda to /dev/sdp.
/dev/sda to /dev/sde ==>> o.s internelly used.
volume attach to ec2 instance ==>>> /dev/sdf to /dev/sdp. (11)
After login into the ec2 instance ==>> device naming convension to display diffrent. ==>>> /dev/xvdf to /dev/xvdp.
Linux admin team follows below steps..
1. fdisk -l ( o.s control )
2. lsblk ==>>> kernel identification.
3. mkfs.ext4 /dev/xvdf ==>> creating the file system.
4. mkdir app5
5. mounting : attaching a directory to the file system. it is called mount point.
mount -t ext4 /dev/xvdf app5
6. cat /etc/mtab ==>> temparary mount points.
7. How to make permanate mount ??
vi /etc/fstab
devicename mountpoint typeoffilesystem defaults 0 (dump) 0 ( check sequence)
/dev/xvdf /home/ec2-user/app5 ext4 defaults 0 0
esc shift:wq!
8. cd app5
ls
lost + found ==>> directory..
touch {a..e}
reboot
===============================================================================
ebs history :
[root@ip-172-31-32-34 ec2-user]# history
1 fdisk -l
2 lsblk
3 mkfs.ext4 /dev/xvdf
4 mkdir app5
5 mount -t ext4 /dev/xvdf app5
6 cat /etc/mtab
7 vi /etc/fstab
8 df -h
9 cd app5/
10 ls
11 touch {a..z}
12 ls
13 cd ..
14 fdisk -l
15 lsblk
16 mkfs.ext4 /dev/xvdg
17 mkdir app6
18 mount -t ext4 /dev/xvdg app6
19 cat /etc/mtab
20 vi /etc/fstab
21 ls
22 cd app6
23 ls
24 touch {1..20}
25 ls
26 cd ..
27 history
[root@ip-172-31-32-34 ec2-user]#
[root@ip-172-31-32-34 ec2-user]# cat /etc/fstab
#
UUID=26620198-186a-404b-b9a1-12d957d7c826 / xfs defaults,noatime 1 1
/dev/xvdf /home/ec2-user/app5 ext4 defaults 0 0
/dev/xvdg /home/ec2-user/app6 ext4 defaults 0 0
[root@ip-172-31-32-34 ec2-user]#
[root@ip-172-31-32-34 ec2-user]#
============================================================================================================
Networking :
Two or more systems connected each other ==>> networking
systems ==>>>nothing but servers.
Physical servers point of view ==>> data center ===>> onpremise infrastructure.
Two servers are in same network ==>>> minimum requirements..
1. Two servers must be cabled with other.
2. Each servers has at least one NIC card ( Network interface card / controller..)
3. Each NIC card has one IPaddress and subnetmask..
4. After login into physical servers==>> eth0 ===>> logic nic name ==>> 192.168.0.1 ( IP address ) and subnetmask ==>> 255.255.255.0.
NIC1 ==>> eth0
NIC2 ==>> eth1
NIC3 ==>> eth2
Based on the hardware ==>> nic slots..==> NICs will attach.
5. Then these two systems in same network.. and these systems communicate with each other..
6. server1 ==>>> login ==>> ping server2IPaddress ==>> ping sequence..
7. server2 ==>>> login ==>> ping server1IPaddress ==>> ping sequence..
======================================================================================
Networking advantages..
1. files transfer ==>>> from one server to another server.
2. Remoteuserly login ==>> from one server to another server. ==>>> applications install..
==========================================================================================
The above requirements to do tasks..==>> we configure the ssh configuration.
ssh : secure shell ==>>>> port number ==>>> 22
ssh : secure sheel
1. server1 to server2 ==>>> files trasfer ==>> encrypted format.
server2 to server1 ==>>> files trasfer ==>> decrypted format.
SSH ==>> no one will hack.
2. ssh : password less authentication.
server1 to server2 ==>>> connect ==>> with out passowrd asking.
server2 to server1 ==>>> connect ==>> with out passowrd asking.
How to configure ssh configuration ??
central.pem ==>> privatekey.
server1 : central.pem ==>> privatekey ==>> copy.
1. vi /tmp/central.pem
paste the privatekey ==>> save
2. chmod 700 /tmp/central.pem
server2 : central.pem ==>> privatekey ==>> copy.
1. vi /tmp/central.pem
paste the privatekey ==>> save
2. chmod 700 /tmp/central.pem
==============================================================================
1. How to transfer files from one server to another server.
server1 to server2 ==>> files transfer
scp : secure copy
touch bhargavi
scp -i /tmp/central.pem filename ec2-user@server2IPaddress(public / private Ip):/home/ec2-user
scp -i /tmp/central.pem bhargavi [email protected]:/home/ec2-user
server2 to server1 ==>> files transfer
scp : secure copy
touch ramakrishna
scp -i /tmp/central.pem filename ec2-user@server1IPaddress(public / private Ip):/home/ec2-user
scp -i /tmp/central.pem ramakrishna [email protected]:/home/ec2-user
====================================================================================================
2. How to login remote userly from one server to another server.
server1 to server2 ==>>> remoteuserly login.
ssh : secure shell
ssh -i /tmp/central.pem ec2-user@server2IPaddress(public / private Ip)
ssh -i /tmp/central.pem [email protected] ==>> enter ==>> now you are in server2.
server2 to server1 ==>>> remoteuserly login.
ssh : secure shell
ssh -i /tmp/central.pem ec2-user@server1IPaddress(public / private Ip)
ssh -i /tmp/central.pem [email protected] ==>> enter ==>> now you are in server1.
=======================================================================================================
ifconfig -a ==>> command
nic card logical name , up , running ,mtu ( memory tranfer unit )==>>9001
nIC ==>>> mac address , IPaddress and subnetmask..
lo : loop back address ==>> self ping ===>> 127( series)
Ipaddress ==>> privateIP.
==>> How to change / assign the IPaddress of linux server ??
cd /etc/sysconfig/network-scripts
ls
ifcfg-eth0 ifcfg-eth1
vi ifcfg-eth0
IPADDR=192.168.20.5
save
service network start
==>> How to change / assign the hostname of the linux server ??
vi /etc/sysconfig/network
hostame = xyz.com
save
service network start
=====================================================================================================
hostname
xyz.com
====================================================================================================
[root@ip-172-31-46-139 network-scripts]# history
1 ping 54.250.156.121
2 ifconfig -a
3 ping 172.31.46.139
4 vi /tmp/kalpana123.pem
5 chmod 700 /tmp/kalpana123.pem
6 touch jyothsna
7 scp -i /tmp/kalpana123.pem jyothsna [email protected]:/home/ec2-user
8 ls
9 ifconfig -a
10 ssh -i /tmp/kalpana123.pem [email protected]
11 ifconfig -a
12 git --version
13 cd /etc/sysconfig/network-scripts/
14 ls
15 vi ifcfg-eth0
16 hostname
17 cat /etc/sysconfig/network
18 vi /etc/sysconfig/network