How to create encrypt and secure partition in RedHat Linux Server

Hello guys in this tutorial we are going to learn how to create encrypt partition in redhat linux server. today world everybody want that our data become secure. we know we have our computer password. So how can anybody create problem for our system.But in case your hard drive loss or any person by mistake take our system password  and  have you very important data in this. then maybe  you not want anybody access your herd drive data. so there for we will create disk encrypt security layer on our herd disk partition partition enccrypt

Step 1 – first we will create partition below Commands

[root@localhost ~]# fdisk /dev/sda
The number of cylinders for this disk is set to 5345.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (4488-5345, default 4488):
Using default value 4488
Last cylinder or +size or +sizeM or +sizeK (4488-5345, default 5345): +200M
Command (m for help): p
Disk /dev/sda: 43.9 GB, 43965677568 bytes
255 heads, 63 sectors/track, 5345 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3187    25599546   83  Linux
/dev/sda2            3188        4462    10241437+  82  Linux swap / Solaris
/dev/sda4            4463        5345     7092697+   5  Extended
/dev/sda5            4463        4487      200781   83  Linux
/dev/sda6            4488        4512      200781   83  Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

Step 2 now we will encrypt partition /dev/sda6 below Commands

[root@localhost ~]# cryptsetup -y -v luksFormat /dev/sda6

Step 3 here we will create mapping for partition

[root@localhost ~]#cryptsetup luksOpen /dev/sda6 vishnu

Step 4 we can look status through below Commands

[root@localhost ~]cryptsetup status vishnu

Step5 now we will format Partition and mount it

[root@localhost ~]mkfs.ext3 /dev/mapper/vishnu

Step6 then we will mount in any folder here i create data1 folder

[root@localhost ~]mkdir /data1
[root@localhost ~]mount /dev/mapper/vishnu

Step 7 now if we want Secure our data we will unmount partition

[root@localhost ~]umount data1

when we will configure security on our herd disk partition. any body can’t access our data if we want access our data in feature  then we will need to mount our partition. so mounting time system will be asking our partition password. if you have any problem in this process so comments here i will solve your problem

Thank you

by Vishnu Sharma

Advertisements

how to configure loopback interface in Cisco Router

Step 1 – at fast we will take two router and two pc and configure ip address like below image 

Step 2 IP address configuration on router 0 
Router>enable
Router#config terminal
Router(config)#hostname r1
r1(config)#interface FastEthernet0/0
r1(config-if)#ip address 1.0.0.1 255.0.0.0
r1(config-if)#no shutdown
r1(config-if)#exit
r1(config)#interface Serial0/0/0
r1(config-if)#ip address 2.0.0.1 255.0.0.0
r1(config-if)#no shutdown
r1(config-if)#exit
r1(config)#int loop 3
r1(config-if)#ip address 4.0.0.1 255.0.0.0
r1(config-if)#exit
r1(config)#int loop 4
r1(config-if)#ip address 5.0.0.1 255.0.0.0

Step 3  IP address Configuration for Router 1

Router>enable
Router#config terminal
Router(config)#hostname r2
r2(config)#interface FastEthernet0/0
r2(config-if)#ip address 3.0.0.1 255.0.0.0
r2(config-if)#no shutdown
r2(config-if)#exit
r2(config)#interface Serial0/0/0
r2(config-if)#ip address 2.0.0.2 255.0.0.0
r2(config-if)#no shutdown
r2(config-if)#exit
r2(config)#int loop 1
r2(config-if)#ip address 6.0.0.1 255.0.0.0
r2(config-if)#exit
r2(config)#int loop 2
r2(config-if)#ip address 7.0.0.1 255.0.0.0
r2(config-if)#exit

Step 4 Static routing for router 0

r1(config)#ip route 3.0.0.1 255.0.0.0 2.0.0.2
r1(config)#ip route 6.0.0.0 255.0.0.0 2.0.0.2
r1(config)#ip route 7.0.0.0 255.0.0.0 2.0.0.2

Step 5 Static routing for router 1

r1(config)#ip route 1.0.0.0 255.0.0.0 2.0.0.1
r1(config)#ip route 4.0.0.0 255.0.0.0 2.0.0.1
r1(config)#ip route 5.0.0.0 255.0.0.0 2.0.0.1

Now your work is Complete you can ping to each ip address. if you have any problem in this process please comments here i will solve your problem. If you want You can also download loop back ip lab through this likn   

Thank you

by Vishnu Sharma

How to configure VLAN in Cisco Switch

Hello guys today we will learn how to configure VLAN(Virtual Area network) in Cisco Switch. Before that we will learn what is VLAN. we can create block in same network through vlan. some times we have to need network block in same network,  imagine that we want to create two networks block in computer lab and our condition  is both block cant’communicate each-other in this condition we will configure VLAN in Switch  you just follow simple Steps

before we will take two switch and eight Computer and provide ip address like this tables

PC 0 PC 1 PC 2 PC 3 PC 4 PC 5 PC 6 PC 7
1.0.0.1 1.0.0.2 1.0.0.3 1.0.0.4 1.0.0.5 1.0.0.6 1.0.0.7 1.0.0.8

Step 2 now will go to switch 1 CLI mod and configure vlan like this

vlan

Switch>en

Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#name ccna
Switch(config-vlan)#exit
Switch(config)#int Fa0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#int fa0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name linux
Switch(config-vlan)#exit
Switch(config)#int fa0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#int Fa0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#

Step 2 we can look our vlan through show vlan commands 

screenshot-83

Step 3 now will go to switchb 2  and Configuration vlan same like this

Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#name ccna
Switch(config-vlan)#exit
Switch(config)#int fa0/1
Switch(config-if)#switchport mod access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#int fa0/2
Switch(config-if)#switchport mod access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name linux
Switch(config-vlan)#int fa0/3
Switch(config-if)#switchport mod access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#int fa0/4
Switch(config-if)#switchport mod access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exitvlan

Step 3 now we r connect both switch and connect VALN 10 and VLAN 20

vlan

Go to Switch 1 and configure trunk on port fa0/5
Switch>en
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int fa0/5
Switch(config-if)#switchport trunk allowed vlan all
Switch(config-if)#switchport mode trunk
Switch(config-if)#

Now go to switch 2 and configure trunk on port fa0/5

Switch>en
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int fa0/5
Switch(config-if)#switchport trunk allowed vlan all
Switch(config-if)#switchport mode trunk

now Cisco switch on complete VLAN configuretion

how to remove VLAN

if we want to remove VLAN then go to switch CLI mode and type just no vlan

Switch(config-if)#no vlan 10
Switch(config)#no vlan 20

if you have any problem in this process then comments here i will solve your problem you can also download vlan lab through this link 

Thank you

by Vishnu Sharma

how to convert heard disk type GPT to MBR

hello guys today we will learn how to convert our system heard disk style GPT(GUID partition table) to MBR(Master boot record) its a very Simple process. we have two way to change disk style during windows installation and on screen windows system .If you install new operating system  and your system is show partition Error like this then you follow just simple stepmdr

Step1 go to windows installation Screen and type Shift+F10 then your system in open Command Prompt. then we will type just Disk part in Command Prompt 

mbr

Step2 then we type List Disk

Step3 now Select our disk which you want change style Select Disk

Step4 then type clean (clean Commands through your disk will be clean /Delete if you not want Clean disk then not use )

Step 5 now type Convert mbr  then your disk will be convert gpt to mbr style 

gpt

if you have any problem in this process so Comment Here i will solve your Problem

you can also watch this video

Thank you

by Vishnu Sharma

How to Configure samba Server in redhat Linux

hello guys today we will learn how to configure samba server in RedHat Linux Server. samba server is a very important in every operating system. we cam share any data one machine to another machine through samba Server. before samba server configuration we need to install some important package. if we want that our Linux machine in all  Package will be install  very easy so we need to YUM Server Configuration i have already write tutorial on yum Server. If you want to know that how to configure yum Server so click on my link and look

samba server

so here i agree your system in have yum server then we will continue

Step 1 = we will install samba Server package through this Commands 

[root@localhost ~]# yum install samba* -y 

Step 2 then we will Create directory for samba server 

[root@localhost ~]# mkdir ishu 

Step 3 now we will Create New User For Samba Interface 

[root@localhost ~]# useradd ishu
[root@localhost ~]# passwd ishu
Changing password for user ishu.
New UNIX password:ishu
BAD PASSWORD: it is too short
Retype new UNIX password:ishu 
passwd: all authentication tokens updated successfully.

Step 5 now we will provide full Permission for user through below Commands

[root@localhost ~]# chmod 7 ishu

Step 5 then we will gave samba user password through this commands

[root@localhost ~]# smbpasswd -a ishu
New SMB password:ishu
Retype new SMB password:ishu 
Added user ishu.

Step 6 Then we will on samba Serves

[root@localhost ~]# service smb restart
Shutting down SMB services:                                [FAILED]
Shutting down NMB services:                                [FAILED]
Starting SMB services:                                     [  OK  ]
Starting NMB services:

Step 7 now we will  off our fire wall and selinux  below Commands

[root@localhost ~]# iptables -F
[root@localhost ~]# setenforce 0

Step 8 now we will look our linux machine ip address through this commands

[root@localhost ~]# ifconfig
eth2      Link encap:Ethernet  HWaddr 08:00:27:35:57:7A
          inet addr:192.168.56.103  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe35:577a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:392911 errors:0 dropped:0 overruns:0 frame:0
          TX packets:30439 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:552717032 (527.1 MiB)  TX bytes:3537248 (3.3 MiB)
          Base address:0xd248 Memory:f0840000-f0860000

Step 9 then we will go in windows system  and open Run windows and type jut linux machine ip address ip address

Step 10 Then we will enter samba user name and password 

if you have any problem in this process so comments here i will solve your problem

Thank you

my Vishnu Sharma

how to create virtual IP Address through real IP address and host multiple Website

hello guys today we will learn how to create virtual IP Address through real IP address and host multiple website on singles system. It’s a very simple process in RedHat Linux Server. Before we will install some necessary package for hosting Virtual IP address. if we want that   all type package install easily in your linux machine  so we have to need YUM server we can configure YUM Server very easily you just lick on my link and look  how to configure YUM server. After YUM server configure you just follow my simple Step

Step 1  here i agree that you have YUM server in our Linux machine then we will continue

[root@localhost ~]# ifconfig
eth2      Link encap:Ethernet  HWaddr 08:00:27:35:57:7A
          inet addr:192.168.56.103  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe35:577a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1933 errors:0 dropped:0 overruns:0 frame:0
          TX packets:632 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:183768 (179.4 KiB)  TX bytes:107123 (104.6 KiB)
          Base address:0xd248 Memory:f0840000-f0860000

 Step2  then we will virtual IP address Here kind this

[root@localhost ~]# ifconfig eth1:0 192.168.56.108

Step3  then we will install php package through yum server

[root@localhost ~]# yum install php* -y

Step4 then we will going following directory /var/www/html/ and here create any folder for our website hosting for example here i create two folder for my two web pages one is php folder two is html folder. And both folder in we will create html file 

[root@localhost ~]# cd /var/www/html/
[root@localhost html]# mk dir php
[root@localhost html]# mkdir html

Step5 here php and html folder in we will create any html files or our past our website content

[root@localhost php]# vim php.php
<?echo
echo "hello this is php demo ";
echo "hello this is php website host demo";
?>
~
~
~
:wq
[root@localhost ~]# cd /var/www/html/html
[root@localhost html]# vim html.html
<html>
<head>this is demo</head>
<title>Demo</title>
<body>
<h1> this is dual webhosting deno in linux machine </h1>
<h2>this dual  webhosting Demo with Virtual IP Address</h2>
</body>
</html>
~
~
~
:wq

Step5 then we will go Apache Configuration File and do something  below configuration

#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
<VirtualHost 192.168.56.103:80>
DocumentRoot /var/www/html/php/
DirectoryIndex php.php
</VirtualHost>
<VirtualHost 192.168.56.108:80>
DocumentRoot /var/www/html/html/
DirectoryIndex html.html
</virtualHost>
"/etc/httpd/conf/httpd.conf" 1000L, 33934C

here we will configure document root  Directory index with real and virtual ip Address

Step 6 then we will restart serves below commands 

[root@localhost ~]# service httpd restart

Step 7 now we will off our Linux machine firewall and selinux through below commands  

[root@localhost ~]# iptables -F
[root@localhost ~]# setenforce 0

Step 8 then we will going to any browser in put our IP address and Virtual ip address. now we will look that our website is looking here

how to create virtual ip address

if you have any problem in this process so please comment here i will solve your problem

Thank you

by Vishnu sharma

 

How to configure RIP Routing in Cisco Packet tracer

hello guys today we will learn how to configure RiP(Routing Information protocol ) Routing in cisco packet tracer its a very simple process you just fillow my step

Rip routing

Step1.  before we will take three router and three pc and we assign ip address According chart   

PC0 1.0.0.2 default geteway 1.0.0.1
PC1 3.0.0.2 default geteway 3.0.0.1
PC2 5.0.0.2 default geteway 5.0.0.1
/Router/all Router port Se/0/0/0 Se/0/1/1 Fa0/0
ROUTER0 2.0.0.1 —– 1.0.0.1
ROUTER1 2.0.0.2 4.0.0.1 3.0.0.1
ROUTER2 ——- 4.0.0.2 5.0.0.1

Step2 we will go in Router 0 CLI mod and congigure ip address like this

Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int Fa0/0
Router(config-if)#ip address 1.0.0.1 255.0.0.0
Router(config-if)#no shut                                                                                                     Router(config-if)#exit
Router(config)#int Se0/0/0
Router(config-if)#ip address 2.0.0.1 255.0.0.0
Router(config-if)#no shut

Step2  now we will go Router1 CLI mod and configure io address

Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int Fa0/0
Router(config-if)#ip address 3.0.0.1 255.0.0.0
Router(config-if)#no shut
Router(config)#exit
Router(config)#int Se0/0/0
Router(config-if)#ip address 2.0.0.2 255.0.0.0
Router(config-if)#no shut
Router(config)#exit
Router(config)#int Se0/1/1
Router(config-if)#ip address 4.0.0.1 255.0.0.0
Router(config-if)#no shut

Srep3 and now we will configure ip address in router2

Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int Fa0/0
Router(config-if)#ip address 5.0.0.1 255.0.0.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#int Se0/1/1
Router(config-if)#ip address 4.0.0.2 255.0.0.0
Router(config-if)#no shut

Step 4 After ip address configuration we will configure each router in ip RIP routing like this

Router o

Router(config)#router rip
Router(config-router)#network 1.0.0.0
Router(config-router)#network 2.0.0.0

Router 1

Router(config)#router rip
Router(config-router)#network 2.0.0.0
Router(config-router)#network 3.0.0.0
Router(config-router)#network 4.0.0.0

Router 2

Router(config)#router rip
Router(config-router)#network 5.0.0.0
Router(config-router)#network 4.0.0.0

if you have problem in this rip routing so comment here i will solve your problem. you can also download rip routing lab through this link

thank you

by Vishnu  Sharma