Author Archives: visworlditsolution

About visworlditsolution

i am student of computer science and geek in information technology

what is Firewall Security ? and How to Configure in RedHat Server

Hello guys today we are going to learn what is Firewall and how to configure Firewall Security in Redhat Linux Server.before we will configure Firewall Security we will Know about some theory of Firewall.

you can teach through this article

1   Structure of firewall

2 Firewall Configuration

3 some important Firewall Commands

4 Block and allow ip address

5 Ethernet Security on port

6 Make address security

7 Domain Address Security

Continue reading

Advertisements

How to encrypt file through open ssl (Secure,Socket,Layer)in Linux RedHat part 1

hello guys today we are going to learn how to encrypt file through open ssl method. but  before  i telling you about open ssl method. open ssl is a file encrypt method in this have several method of file encrypting its a very strong method . this tutorial in  we will discuss some use full and strong encrypt method and we will also learn how can we apply on our file.

Step 1 here we will install openssl package through Yum Server if you want to know how to configure yum Server in linux redhat  so click this link and look

[root@localhost exp]# yum install openssl -y

now first we will learn base64 method in this method we can write encrypted content and also make encrypted file so you just follow me and look with piratical

 

Step 2 before we will learn how to write encrypt text through  base64

[root@dhcppc16 ~]# echo "hello this is encrypt method base64 demo"|openssl enc -base64
aGVsbG8gdGhpcyBpcyBlbmNyeXB0IG1ldGhvZCBiYXNlNjQgZGVtbwo=

now if we want to decriypt  content we will just put our encrypt content mid in” “and run command

[root@dhcppc16 ~]# echo "aGVsbG8gdGhpcyBpcyBlbmNyeXB0IG1ldGhvZCBiYXNlNjQgZGVtbwo="|openssl enc -base64 -d 
hello this is encrypt method base64 demo

Step 3 we can encrypt any file through this Commands

[root@localhost exp]# openssl enc -base64 -in a.txt -out a.enc
[root@localhost exp]# ls
a.enc  a.txt
[root@localhost exp]# rm -rf a.txt
[root@localhost exp]# cat a.enc
IGhlbGxvIHRoaXMgaXMgbXkgZGVtbyBmaWxlCg==

we can decrypt file through this below Commands

[root@localhost exp]# openssl enc -base64 -d -in a.enc -out a.txt
[root@localhost exp]# ls
a.enc  a.txt
[root@localhost exp]# rm -rf a.enc
[root@localhost exp]# cat a.txt
 hello this is my file encryption base64 demo

Step 4 Encrypt and decriypt a File or message using AES-256-cvc method

[root@localhost exp]# echo "hello this is AES-256-CVC demo"|openssl enc -aes-256-cbc >a.bat
enter aes-256-cbc encryption password: 12345
Verifying - enter aes-256-cbc encryption password:12345
[root@localhost exp]# ls
a.bat
[root@localhost exp]# cat a.bat
Salted__Y,@o???a?4???tc(t[?c???$F^?$O???|??[root@localhost exp]#

now we will decriypt through below commands

[root@localhost exp]# echo "hello this is AES-256-CVC demo"|openssl enc -aes-256-cbc -d -in a.bat
enter aes-256-cbc decryption password:12345
hello this is AES-256-CVC demo

here we will learn if we have already any file we want encrypt then we will use below commands

[root@localhost exp]# openssl enc -aes-256-cbc -in a.txt -out a.bat
enter aes-256-cbc encryption password:12345
Verifying - enter aes-256-cbc encryption password:12345
[root@localhost exp]# ls
a.bat  a.txt
[root@localhost exp]# cat a.bat
Salted__?cJ??D^??0?7??6?i???+?#??7??+?z
+^W?[root@localhost exp]#
we can decrepit file through this Commands 
[root@localhost exp]# openssl enc -d -aes-256-cbc -in a.bat -out a.txt
enter aes-256-cbc decryption password:
[root@localhost exp]# ls
a.bat  a.txt
[root@localhost exp]# cat a.txt
hello this is my file demo

if you have any problem in this process so please Comments here i will solve your problem otherwise like share and follow my blog for Linux Networking and IT Solution

thank you

BY Vishnu Sharma

how to write encrypt text content in RedHat Linux server part -1

hello guys today we will learn how to write encrypt text. actually encrypt matter is provide security our data .if we will write encrypt content then anybody con’t read our data or content . Linux Server in have many encrypted method here we will discuss some method  encrypt text

Step 1 here i encrypt some numeric digit for eg. 7297868765

[root@localhost exp]# echo "7297868765" |tr '0-9' '9876543210' >e.txt (Note- here i encrypt 7297869765 numeric and
 this digit is  encrypt matter in put in e.txt file)

if we want look e.txt file then we look encrypt numeric content

[root@localhost exp]# cat e.txt
2702131234  

now we want to receive original data then we fire below commands

[root@localhost exp]# echo "27021311234" |tr '0-9' '9876543210' >f.txt (Note- Here we will put encrypt file content)
[root@localhost exp]# cat f.txt 
72978688765

Step 3 now we will encrypt text matter below commands

[root@localhost exp]# echo "hello this is file content encrypt Demo "|tr 'a-zA-Z' 'nza-mN-ZA-M' >a.txt
[root@localhost exp]# ls
a.txt
[root@localhost exp]# cat a.txt
fcjjm RfgQ gQ dgjc amlRnlR claPWNR Bckm
[root@localhost exp]# echo "fcjjm rfgQ gQ dgjc amlRn1R claPWNR Bckm "|tr 'a-zA-Z' 'nza-mN-ZA-M' >b.txt (Note- Here we will put encrypt file content)
[root@localhost exp]# ls
a.txt  b.txt
[root@localhost exp]# cat b.txt
hello this is file content encrypt demo

4 Here we will learn how to encrypt numeric and text

[root@localhost exp]# echo "Hello my name is vishnu my mobile is 7297868765"|tr 'a-zA-Z0-9' 'n-za-mN-ZA-M9876543210' >a.txt
[root@localhost exp]# ls
a.txt
[root@localhost exp]#cat a.txt
Uryyb zl anzr vf ivfuah zl zbovyr vf 2702131234
(Note-if we want decrypt contant .then we will put encrypt code )
[root@localhost exp]# echo "Uryyb zl anzr vf ivfuah zl zbovyr vf 2702131234"|tr 'a-zA-Z0-9' 'n-za-mN-ZA-M9876543210' >b.txt
[root@localhost exp]# ls
a.txt b.txt
[root@localhost exp]# cat b.txt
Hello my name is vishnu my mobile is 7297868765

if you have any problem in this process please comment here i will solve your problem otherwise like share and follow my website

Thank you

by Vishnu Sharma

Key based security (Digital Signature )with gpg encryption in RedHat Linux Server

Hello guys today we will learn how to configure key based Security in RedHat Linux. its a very simple process you just Follow my Simple Steps

file encrypt

Step 1 here i Create a.txt File and put something text matter in this file

[root@localhost exp]# vim a.txt
Hello this is my Digital key signature demo in linux redhat Server
~
~
~
~
:wq

Step 2 then we will encrypt our file below commands

[root@localhost exp]# gpg -c a.txt
Enter passphrase: redhat
Repeat passphrase: redhat
(Note-Here we will remove a.txt file then we have a.txt.gpg file. this is a encrypt file )
[root@localhost ~]# rm -rf a.txt
(Note- now we will open a.txt.gpg file then we will found encrypt data )
[root@localhost ~]# cat a.txt.gpg
?Q]?q*k?`????@?E?x??[???F??{??6Q??

Step 3 now we can get original file data through below commands

[root@localhost ~]# gpg -d a.txt.gpg
gpg: CAST5 encrypted data
Enter passphrase:redhat
Hello this is my Digital key signature demo in linux redhat Server
(Note- if we want remove encrypt security we will used below Commands)
[root@localhost exp]# gpg a.txt.gpg
gpg: CAST5 encrypted data
gpg: encrypted with 1 passphrase
gpg: WARNING: message was not integrity protected
[root@localhost exp]# ls
a.txt  a.txt.gpg

now suppose we have multi pal file and we want to protract  all file then we can use digital key.if we will create digital key then again to again no need to create password any time we can apply same password on all file through digital key .

Step 4 then we will Create Digital key through below Commands

[root@localhost exp]# gpg --gen-key
gpg (GnuPG) 1.4.5; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.
Please select what kind of key you want:
   (1) DSA and Elgamal (default)
   (2) DSA (sign only)
   (5) RSA (sign only)
Your selection? 1 (note- here we will select 1 )
DSA keypair will have 1024 bits.
ELG-E keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 2048 (note- here we will put our key bits size)
Requested keysize is 2048 bits
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0) 0 (notes- here we will select 0 becouse we want not Expiry key )
Key does not expire at all
Is this correct? (y/N) y
You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
    "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"
Real name: vishnu sharma        (note- here we will put our name email Address and something Comments)
Email address: vlalitsharma@gmailcom  
Comment: this is digital key password
You selected this USER-ID:
    "vishnu sharma (this is digital key password) <vlalitsharma@gmailcom>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o (note- here will press o for okay)
ou need a Passphrase to protect your secret key. (Note- here we will put our password )
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
.++++++++++++++++++++++++++++++.++++++++++..+++++++++++++++.+++++++++++++++++++++++++++disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
.++++++++++..+++++++++++++++.++++++++++..+++++++++++++++..++++++++++..++++++++++++++++++
gpg: key 52747DF7 marked as ultimately trusted
public and secret key created and signed.
gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   2  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 2u
pub   1024D/52747DF7 2017-03-10
      Key fingerprint = B00B 24CC CA58 9DBB AC29  DFB5 7DBF FE59 5274 7DF7
uid                  vishnu sharma (this is digital key password) <vlalitsharma@gmailcom>
sub   2048g/1C25308A 2017-03-10

Step 5 here we will look our file key below Commands

[root@localhost exp]# gpg --list-key
/root/.gnupg/pubring.gpg
------------------------
pub   1024D/5B148026 2017-03-09
uid                  vishnu sharma (hindiitsolution.com) <vlalitsharma@gmail.com>
sub   2048g/7DB30C64 2017-03-09

Step 6 now we will provide key on file through below Commands

[root@localhost exp]# gpg -e -r 'vlalitsharma@gmail.com' a.txt(Note- here we will gave file name which we want protract)

Step 7 we can also broken file in parts through gpg commands 

[root@localhost exp]# gpgsplit a.txt.gpg
[root@localhost exp]# ls
000001-001.pk_enc  000002-018.encrypted_mdc  a.txt  a.txt.gpg

Step 6 we can combine our file below Commands 

[root@localhost exp]# cat 000001-001.pk_enc 000002-018.encrypted_mdc >a.txt
[root@localhost exp]# ls
000001-001.pk_enc  000002-018.encrypted_mdc  a.txt 

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

Thank you

by Vishnu Sharma

How to Write and compile C Programs in RedHat Linux Server

Hello guys in this tutorial we are going to learn how to write and Compile C program in RedHat Linux Server.Its a very simple process you just need to following Simple Steps. At Fast we will Install C Compiler in Linux Server. we will install C Compiler through Yum Server. If you don’t have any idea about YUM server so please click and look how to install yum server in Redhat LInux Serverc labguage Step 1 Here i accept you configure YUM server in redhat linux, then we will install C -Compiler t through below Commands

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

Step 2 then we will write C Program like this

[root@localhost ~]# vim vishnu.c
#include<stdio.h>
void main()
{
printf("hello this is my linux server c programming demo');
}
~
:wq

Step 3 then we will compile Program below Commands

[root@localhost ~]# gcc vishnu.c -o cprogram

Step 4 now if we don’t found any error in this  program then we will run below commands 

[root@localhost ~]# ./cprogram
hello this is my linux server c programming demo

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

Thank you

Vishnu Sharma

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

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