Wednesday, January 20, 2021

How to Install OpenVPN Server on RHEL / CentOS 8 and configure Windows / Linux OpenVPN Client ?

 This guide will explain how to install and configure OpenVPN Server on RHEL / CentOS 8. A Virtual Private Network (VPN) allows you to traverse untrusted networks securely as if you were within a secure LAN network. OpenVPN is a full-featured, open-source Secure Socket Layer (SSL) VPN solution that supports a wide range of configurations.

With OpenVPN, you can easily set a secure tunnel that extends private network across a public network. All traffic being sent is encrypted and you can trust the information received on the other end. In this blog post, we will explore an easy way of installing and configuring OpenVPN server on RHEL / CentOS 8 server.

Install OpenVPN Server on RHEL / CentOS 8

There are two options of setting up OpenVPN server on RHEL / CentOS 8.

1.    Installing OpenVPN server manually – Time consuming

2.    Install OpenVPN server using automated scripts – Easy and quick

This guide will focus on using a trusted script to install and configure OpenVPN server. We will use openvpn-install script which let you set up your own VPN server in no more than a minute, even if you haven’t used OpenVPN before. It has been designed to be as unobtrusive and universal as possible.

Step 1: Add EPEL and Install git

Add EPEL repository to your RHEL / CentOS 8 system. It has openvpn package and dependencies required.

How to Install EPEL Repository on RHEL / CentOS 8

We also need git to pull the code from Github. Ensure it is installed.

sudo dnf -y install git

Step 2: Clone openvpn-install repository

Now clone the openvpn-install repository using git tool installed in Step one:

$ cd ~
$ git clone
https://github.com/Nyr/openvpn-install.git
Cloning into 'openvpn-install'…
remote: Enumerating objects: 360, done.
remote: Total 360 (delta 0), reused 0 (delta 0), pack-reused 360
Receiving objects: 100% (360/360), 104.04 KiB | 263.00 KiB/s, done.
Resolving deltas: 100% (180/180), done.

Step 3: Run OpenVPN installer

Switch to the openvpn-install directory and run the installer script.

$ chmod +x openvpn-install.sh
$ sudo ./openvpn-install.sh

You will get a couple of prompts to change or confirm default settings for the installation.

Welcome to this OpenVPN "road warrior" installer!
 I need to ask you a few questions before starting the setup.
 You can leave the default options and just press enter if you are ok with them.
 First, provide the IPv4 address of the network interface you want OpenVPN
 listening to.
 IP address: 192.168.122.198
 This server is behind NAT. What is the public IPv4 address or hostname?
 Public IP address / hostname:
vpn.example.com
 Which protocol do you want for OpenVPN connections?
    1) UDP (recommended)
    2) TCP
 Protocol [1-2]: 1
 What port do you want OpenVPN listening to?
 Port: 1194
 Which DNS do you want to use with the VPN?
    1) Current system resolvers
    2) 1.1.1.1
    3) Google
    4) OpenDNS
    5) Verisign
 DNS [1-5]: 1
 Finally, tell me your name for the client certificate.
 Please, use one word only, no special characters.
 Client name: computingforgeeks
 Okay, that was all I needed. We are ready to set up your OpenVPN server now.
 Press any key to continue…
 Updating Subscription Management repositories.
 Updating Subscription Management repositories.
 Extra Packages for Enterprise Linux 7 - x86_64                                                                         189 kB/s |  16 MB     01:24   
 Last metadata expiration check: 0:00:54 ago on Wed 20 Mar 2019 07:23:31 PM EAT.
 Package epel-release-7-11.noarch is already installed.
 Dependencies resolved.
 Nothing to do.
 Complete!
 Updating Subscription Management repositories.
 Updating Subscription Management repositories.
 Waiting for process with pid 1906 to finish.
 Package iptables-1.8.0-11.el8.x86_64 is already installed.
 Package openssl-1:1.1.1-6.el8.x86_64 is already installed.
 Package ca-certificates-2018.2.24-6.el8.noarch is already installed.
 Dependencies resolved.
  Package                           Arch                    Version                           Repository                                           Size
 Installing:
  openvpn                           x86_64                  2.4.7-1.el7                       epel                                                522 k
 Installing dependencies:
  pkcs11-helper                     x86_64                  1.11-3.el7                        epel                                                 56 k
  libnsl                            x86_64                  2.28-18.el8                       rhel-8-for-x86_64-baseos-beta-rpms                   84 k
  compat-openssl10                  x86_64                  1:1.0.2o-3.el8                    rhel-8-for-x86_64-baseos-beta-rpms                  1.1 M
 Transaction Summary
 Install  4 Packages
 Total download size: 1.8 M
 Installed size: 4.6 M
 Downloading Packages:
 (1/4): pkcs11-helper-1.11-3.el7.x86_64.rpm                                                                              34 kB/s |  56 kB     00:01   
 (2/4): openvpn-2.4.7-1.el7.x86_64.rpm                                                                                  191 kB/s | 522 kB     00:02   
 (3/4): libnsl-2.28-18.el8.x86_64.rpm                                                                                    26 kB/s |  84 kB     00:03   
 (4/4): compat-openssl10-1.0.2o-3.el8.x86_64.rpm
.......................                

You need to set:

·       Server’s IP address to be used by VPN

·       The hostname of Server if inside NAT

·       OpenVPN protocol to be used – TCP or UDP

·       OpenVPN port

·       DNS Nameserver to be used with VPN

·       Name of first client profile to create

If the installation was successful, you should receive message similar to one below.

..............
 Check that the request matches the signature
 Signature ok
 The Subject's Distinguished Name is as follows
 commonName            :ASN.1 12:'computingforgeeks'
 Certificate is to be certified until Mar 17 16:24:47 2029 GMT (3650 days)
 Write out database with 1 new entries
 Data Base Updated
 Using SSL: openssl OpenSSL 1.1.1 FIPS  11 Sep 2018
 Using configuration from /etc/openvpn/easy-rsa/pki/safessl-easyrsa.cnf
 Can't load /etc/openvpn/easy-rsa/pki/.rnd into RNG
 140135296710464:error:2406F079:random number generator:RAND_load_file:Cannot open file:crypto/rand/randfile.c:90:Filename=/etc/openvpn/easy-rsa/pki/.rnd
 An updated CRL has been created.
 CRL file: /etc/openvpn/easy-rsa/pki/crl.pem
 788
 success
 success
 success
 success
 success
 success
 612
 Created symlink /etc/systemd/system/multi-user.target.wants/openvpn@server.service → /usr/lib/systemd/system/openvpn@.service.
 Finished!
 Your client configuration is available at: /root/computingforgeeks.ovpn
 If you want to add more clients, you simply need to run this script again!

The main OpenVPN server configuration file is,/etc/openvpn/server.conf you are free to tune it to your liking.

$ cat  /etc/openvpn/server.conf

port 1194

proto udp

dev tun

sndbuf 0

rcvbuf 0

ca ca.crt

cert server.crt

key server.key

dh dh.pem

auth SHA512

tls-auth ta.key 0

topology subnet

server 10.8.0.0 255.255.255.0

ifconfig-pool-persist ipp.txt

push "redirect-gateway def1 bypass-dhcp"

push "dhcp-option DNS 192.168.122.1"

keepalive 10 120

cipher AES-256-CBC

user nobody

group nobody

persist-key

persist-tun

status openvpn-status.log

verb 3

crl-verify crl.pem

A  tun0 virtual interface will be created during the setup process. This is used by OpenVPN clients subnet.

$ ip addr | grep tun0
 3: tun0:  mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 100
     inet 10.8.0.1/24 brd 10.8.0.255 scope global tun0

The default subnet for this interface is.10.8.0.0/24.OpenVPN server will be assigned 10.8.0.1 IP address:

Step 3: Generate OpenVPN user profile (.ovpn file)

After completing step 1 through 3, your VPN Server is ready for use. We need to generate VPN Profiles to be used by the users. The same script we used for the installation will be used for this. It manages the creation and revocation of user profiles.

Run script and select 1 to add new user.

$ sudo ./openvpn-install.sh

Looks like OpenVPN is already installed.
 What do you want to do?
    1) Add a new user
    2) Revoke an existing user
    3) Remove OpenVPN
    4) Exit
 Select an option [1-4]: 1
 Tell me a name for the client certificate.
 Please, use one word only, no special characters.
 Client name: user1
 Using SSL: openssl OpenSSL 1.1.1 FIPS  11 Sep 2018
 Can't load /etc/openvpn/easy-rsa/pki/.rnd into RNG
 139966006863680:error:2406F079:random number generator:RAND_load_file:Cannot open file:crypto/rand/randfile.c:90:Filename=/etc/openvpn/easy-rsa/pki/.rnd
 Generating a RSA private key
 ……………………………………………………………………..+++++
 ……………………………………….+++++
 writing new private key to '/etc/openvpn/easy-rsa/pki/private/user1.key.SeCj8ncgaH'
 Using configuration from /etc/openvpn/easy-rsa/pki/safessl-easyrsa.cnf
 Can't load /etc/openvpn/easy-rsa/pki/.rnd into RNG
 139828629223232:error:2406F079:random number generator:RAND_load_file:Cannot open file:crypto/rand/randfile.c:90:Filename=/etc/openvpn/easy-rsa/pki/.rnd
 Check that the request matches the signature
 Signature ok
 The Subject's Distinguished Name is as follows
 commonName            :ASN.1 12:'user1'
 Certificate is to be certified until Mar 17 16:48:32 2029 GMT (3650 days)
 Write out database with 1 new entries
 Data Base Updated
 Client user1 added, configuration is available at: /root/user1.ovpn

The .ovpn OpenVPN profile file is placed inside /root folder.

$ sudo ls /root/ | grep ovpn
computingforgeeks.ovpn
user1.ovpn

Revoking OpenVPN user profile

To revoke a user profile, run the script and select 2.

$ sudo ./openvpn-install.sh
Looks like OpenVPN is already installed.
 What do you want to do?
    1) Add a new user
    2) Revoke an existing user
    3) Remove OpenVPN
    4) Exit
 Select an option [1-4]: 2
 Select the existing client certificate you want to revoke:
      1) computingforgeeks
      2) user1
 Select one client [1-2]: 2
 Do you really want to revoke access for client user1? [y/N]: y
 Using configuration from /etc/openvpn/easy-rsa/pki/safessl-easyrsa.cnf
 Can't load /etc/openvpn/easy-rsa/pki/.rnd into RNG
 140410149218112:error:2406F079:random number generator:RAND_load_file:Cannot open file:crypto/rand/randfile.c:90:Filename=/etc/openvpn/easy-rsa/pki/.rnd
 Revoking Certificate FAC5CC0C127D1242CC55BD31B7FB27D3.
 Data Base Updated
 Using SSL: openssl OpenSSL 1.1.1 FIPS  11 Sep 2018
 Using configuration from /etc/openvpn/easy-rsa/pki/safessl-easyrsa.cnf
 Can't load /etc/openvpn/easy-rsa/pki/.rnd into RNG
 139874879330112:error:2406F079:random number generator:RAND_load_file:Cannot open file:crypto/rand/randfile.c:90:Filename=/etc/openvpn/easy-rsa/pki/.rnd
 An updated CRL has been created.
 CRL file: /etc/openvpn/easy-rsa/pki/crl.pem
 Certificate for client user1 revoked!

Uninstalling OpenVPN server on RHEL/CentOS 8

If you no longer need OpenVPN server, uninstallation can be done using the same installer script.

$ sudo ./openvpn-install.sh
Looks like OpenVPN is already installed.
 What do you want to do?
    1) Add a new user
    2) Revoke an existing user
    3) Remove OpenVPN
    4) Exit
 Select an option [1-4]: 3
 Do you really want to remove OpenVPN? [y/N]: y
 788
 success
 success
 success
 success
 success
 success
 Updating Subscription Management repositories.
 Updating Subscription Management repositories.
 Dependencies resolved.
....
Complete!
OpenVPN removed!

Step 4: Connect to OpenVPN Server from the client

You can use the VPN client of your choice to configure OpenVPN client on your operating system. For those who want to use Official OpenVPN client, go to the downloads page and get the latest release then install it.

Once Installed, on Windows, navigate to the directory with the ovpn profile, right click on the file name and select “Start OpenVPN on this config file

For CentOS Linux users, you can use NetworkManager and openvpn plugin to connect to OpenVPN server.

Install NetworkManager on CentOS 7

CentOS 7 comes with NetworkManager installed and running, you only need to install openvpn plugin for you to be able to import .ovpn profile.

sudo yum install NetworkManager-openvpn NetworkManager-openvpn-gnome

How to Import OpenVPN profile (.ovpn) using nmcli

Once you have installed the required packages and you have OpenVPN profile generated, continue to import the profile.

In this example, I assume OpenVPN profile name is called myopenvpn.ovpn and is located under your $HOME. Import the profile using the command:

$ cd ~/
$ sudo nmcli connection import type openvpn file myopenvp.ovpn
Connection 'myopenvp' (464b7c20-8999-4699-a4d7-3233cd7ea91e) successfully added.

You can confirm if the profile was imported successfully using the command:

$ nmcli connection show

To start using the profile, bring it up using:

nmcli connection up myopenvpn
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/27)

To check the connection details using:

$ nmcli connection show 
$ nmcli connection show |  egrep -i 'IP4|IPV6'

Depending on how you configured your OpenVPN server routes push, you can check ones populated on the server:

$ ip route

Try access any network on the route to see if it’s working.

Conclusion

You have successfully installed the OpenVPN server on RHEL/CentOS 8. The computers at each end of the VPN tunnel will encrypt the data entering the tunnel and is decrypted at the other end. Check OpenVPN documentation for more configuration options.

 

Monday, January 18, 2021

How to find how many times you’ve visited a website?

By default, all Web browsers allow you to check the list of previously visited websites but only a few let you count their numbers. Browsers like Firefox support this capability while others like Chrome help you find it through an extension. So, if you want to know how many times you’ve visited a website, using Firefox or Chrome, read on.

Find out how many times you’ve visited a website

Finding how many times you’ve visited a website is an effective way of monitoring someone to ensure that they are using Internet resources correctly. In Firefox, do the following.

  1. Launch Firefox.
  2. Open Menu.
  3. Choose Library.
  4. Expand the History menu.
  5. Scroll down to Show all History.
  6. Switch to View column.
  7. Expand Show Columns menu.
  8. Choose Visit Count.

Mozilla Firefox has an in-built feature that shows you how many times you have visited a web site. Make sure you are using the latest version of the browser.

Launch the Firefox browser.

Firefox History

Open the menu (visible as 3 horizontal bars) and choose Library from the list of options displayed.

Next, move to the History section and scroll down to click Show all History option.

When the Library window opens, click the Views drop-down arrow.

Visit Count

Expand the Show Columns menu and choose Visit Count from the list of options visible. This will help you find the number of times you visited a website. You can change the timeline as per your preferences.

Chrome browser

History Trends calculation

For the Chrome browser, there’s no default option to check the number of times you visited a website.

As a workaround, you can try the History Trends Chrome extension.

The extension analyzes your entire browsing history and displays a variety of charts and statistics. It displays the number of visits too as Top 10 most visited domains. Apart from this, it displays the following stats and charts:

  • Total URLs visited and the total number of visits
  • Top 10 most visited URLs
  • Top 10 busiest days
  • Chart of visits by an hour of the day
  • Chart of visits by day of week
  • Chart of visits by day of the month
  • Chart of visits by month
  • Chart of transition type (e.g., link, bookmark, reload, etc)

Simply click the extension icon and allow the extension to calculate your trends ,It should be noted that you can access or find the number of visits up to the past 3 months of history only as this is the limit set by Google Chrome.

Sunday, January 17, 2021

How to free up Space and Remove all Junk , temp and unnecessary Files on Windows 10

 In this article, I will show you how to remove junk files from windows 10. If your Windows speed is slow and has low storage space, it is better to remove all the junk files from Windows. As you know that, if we use the Windows system for a long time, the extra junk files will be saved in the background folder of Windows. Just follow this easy instruction to remove all junk files from windows 10.

How to Remove All Junk Files from Windows 10


In this article, I will show you how to remove junk files from windows 10. If your Windows speed is slow and has low storage space, it is better to remove all the junk files from Windows. As you know that, if we use the Windows system for a long time, the extra junk files will be saved in the background folder of Windows. Just follow this easy instruction to remove all junk files from windows 10.

1#. Delete Recycle Bin Files
The files in the recycle bin are all junk files, just delete them all to free up your storage space. 
If anytime you want to delete the unnecessary or junk files straight, you can Shift+Delete
junk files will not remain in the recycle bin.


2#. Storage Sense
Windows can automatically free up space by getting rid of files you don’t need, like temporary files 
and content in your recycle bin. Just make On storage sense to automatically remove junk files. 
And also, you can manage storage sense setting, from change how we free up space automatically. 
Here you can manage after how many days your Windows remove junk files and free up storage space.


3#. Free Up Space Now

In this part also you can remove temporary files like; Windows defender antivirus, 
Windows update cleanup, or thumbnails. Just choose which items you want to 
permanently remove to free up Disk Space.

Go to Setting> System> Storage> Free up space now

4#. Disk Cleanup

By disk cleanup option you can remove all junk files from hard disk, it can free up your space. 
It means, disk cleanup can delete temporary files, recycle bin, temporary internet files, thumbnails, 
and also you can Clean up system files. If you want to free up more space you can choose 
the compress the drive to save the disk space option.



5#. Remove Temp Files

You can remove the background junk files from Windows 10, in the background of Windows 10 
you can delete all the temp files, these files are junk and unnecessary file.
just press Windows + R> %temp%, select all and delete.

6#. Using Ccleaner Software

This software can help you easily remove junk files from Windows. This software covers the system 
junk files, the internet explorer history and pages, the Windows explorer useless files, the windows junk 
files, and more other actions. Just manage which part you want to delete, click on Run Cleaner. It will 
scan all the junk files from Windows and then you can easily remove them.

Conclusion:

It is better to remove the junk files each in every week, by this method all the junk files will be removed.
 Storage space will remain free and also Windows will work faster. Mostly junk files saved on Windows
 when we install more software and use more internet connection. These files will be saved in a 
temporary folder. Try to check each in every week the junk files and remove all the junk files from 
Windows 10.

Monday, November 2, 2020

How to uninstall the Your Phone app Windows 10?

 If you want to get rid of the app, or you're having problems, and the reset option doesn't work, you can uninstall it using PowerShell with these steps:

  1. Open Start.
  2. Search for Windows PowerShell, right-click the top result and select
  3.  Run as Administrator.
  4. Type the following command to uninstall the app and press Enter:

    Get-AppxPackage Microsoft.YourPhone -AllUsers | Remove-AppxPackage



Monday, October 26, 2020

How To Secretly Hide Folder/s or any Type of Files behind An Image

 

How To Secretly Hide Folder/s or any Type of Files behind An Image

How To Hide Your Secret Files Behind An Image: - Yes, you heard it right? You can hide all your secret files behind a harmless looking image file. No one would be able to guess where you have safely hidden all your secret data. This is an amazing trick that you should try today yourself. So let us Start to learn how to hack this amazing trick!

 

STEP 1

  •        First of all, create a folder or choose any folder in your hard disk drive .

STEP 2

·        Add all those files into this folder that you want to hide from others. You can add any sort of files including music files, documents, videos, your secret diary etc.



STEP 3

·        Now you need to compress all these files and make it a single file. For that I have used winrar. You can use any compression software of your choice. Another popular compression software is winzip or  7-Zip.



STEP 4

  • Now, open Command Prompt by typing cmd into your search box and launch it from the results that appear.

STEP 5

·        As next, copy-paste or type in the following commands one by one into your Command Prompt and hit Enter after each command.

Format

cd Folder Path\Name of the folder containing secret files

copy /b Name of the image file.jpg + Name of the zip file.zip Name of the image file.jpg

Example

cd D:\Important_Files

copy /b howto.jpg + Important_Files.zip newpicturename.jpg

 



That’s it. Now you can exit from the Command Prompt by either typing exit or simply by closing it. Refer to the screenshot given below in case you come across any difficulties.

Note : It is very important to take care of the special symbols like / and space while entering commands.

STEP 6

·        Now you can get back to the original folder. You can delete all the files including important_Files.zip AND KEEP ONLY THE NEWLY GENERATED PICTURE .

 

·        After this step, only the image file , i.e, newpicturename.jpg will remain in the Important_Files folder.




 



STEP 7

·        Now right click on the image file and then choose Open with. Choose a decompression software from the list. I have chosen winrar File Manager.



STEP 8

·        There you are! Now you can extract your secret files from your secret image file just like that.

After it is created, you can move the image file containing your secret files to any location as per your choice. You can save it anywhere, though, as no one would guess such a big secret could be lying under a sweet cute image. Feel free to leave comments in case you need assistance with any of the steps.

 




Sunday, October 25, 2020

How to Generate a QR code with your the access details to share your Wi-Fi access with your friends coming to your house

To share your Wi-Fi access with your friends coming to your house Simply go to  Generate a QR code  Put your access details. 

Print it and stick it on the wall.




How to Check a website is safe to visit or Not ?

Google’s Safe Browsing technology examines billions of URLs per day looking for unsafe websites. Every day, Google discover thousands of new unsafe sites, many of which are legitimate websites that have been compromised. When we detect unsafe sites, Google show warnings on Google Search and in web browsers. You can search to see whether a website is currently dangerous to visit.

Use the follwoing URL and change the red marked with your site you want to examine .

http://www.google.com/safebrowsing/diagnostic?site=spotlightshowto.blogspot.com