Monthly Archives: April 2018

How to install JDK on Windows

This tutorial will show you how to install JDK on windows. The version of windows we are using is windows sever 2016 although the process should be much the same for all versions of windows.

Step 1

Navigate to the oracle site by clicking on the below URL.

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Step 2

Click to accept the licence and select the 64 bit windows installer to download.

Step 3

When the install downloads double click it. On the screen the appears click next

Step 4

Click next again

Step 5

Confirm the install folder and click next.

JDK will then install, when it’s completed you will see a screen similar to the one below.

 

A full video tutorial can be found below:

How to Install VirtualBox guest additions on Windows

Subscribe to Darrenoneill.eu to get a free Linux Cheat Sheet! 

This short tutorial will shows you how to install VirtualBox guest additions on Windows. Guest additions consist of device drivers and system applications that optimize the guest operating system for better performance and usability.

In this tutorial we are using windows server 2016, however this guide should work on most versions of Windows.

First click on Devices and then click insert Guest Additions CD Image

Next navigate to Computer / this PC

Now double click on VirtualBox Guest Additions

We then clicked on the VBoxWindowsAdditions-amd64 (if you are running a 32bit system you can select the 32 bit version)

Then simply step through the wizard to complete the installation.

When prompted reboot the system when it is fully rebooted you will have guest additions installed.

A full video tutorial can be found here:

Java Keytool Tutorial: How to generate a Self-Signed cert using Java Key tool

The Java keytool allows your to generate certs that you can use with applications such as Tomcat. The below tutorial will show you how to generate a self signed cert that you can use with your applications.

It starts from the very beginning and shows you how to install Java, set up a key store and generate your jks cert.

Installing  Java

  • Download Windows x64 it version of java.
  • Once it had downloaded, install it.

Add Java to the Path

  • Let’s add the Java bin folder to the path so we can run the keytool from anywhere
  • It is most likely available from; C:\Program Files\Java\jdk1.8.0_161\bin
  • First click on the start menu, search for my computer right click on This PC and click properties

  • Click advanced system settings and then environment variables

Click path and then edit.

Ensure there is a ; before you paste in the bin path for Java.

Paste the path in and click ok

 

Click ok and ok again.

Generating the Certificate and keystore 

  • We will now generate our keystore and cert. open a command prompt as an admin and run the following command.
    • keytool -genkey -alias darren -keyalg RSA -keystore “C:\local.keystore”
  • You will then be asked a series of questions
    • enter Keystore password:
    • retype keystore:
    • what is your first and last name: (enter your domain name)
    • what is the name of your organisation unit:
    • what is the name of your organisation:
    • what is the name of your state or province:
    • What is the two-letter country code for this unit:
  • Enter values relevant to you
  • In our case the output looks like this:

  • We can confirm that there is a certificate we can use by checking the keystore.
    • cd back to the c drive
    • run the command cd c:\
    • next run dir.
  • you should now see

  • You can now run:
    • keytool -v -list -keystore local.keystore
    • to view the self-signed certificate in the keystore

A full video tutorial can be found here:

How to Disable Internet Explorer Enhanced Security Configuration in Windows Server 2016

Enhanced Security Configuration (IE ESC) is designed to protect a server from dangerous websites capable to infect system with malware. However it is extremely restrictive and can make many tasks extremely tedious. You can disable it by following the below steps.

Click the start menu and search for server manager

Click on the server manager to open it.

When it opens click on Local Server.

Click on beside IE Enhanced Security Configuration.

In the screen that appears select Off for Administrators and Users. and click OK.

 

 

Restart Internet explorer for your changes to take affect.

A full video tutorial can be found here:

 

How to statically assign DNS in CentOS 7

You can statically assign DNS in Centos 7. In this example we will assign Googles DNS, which is:

8.8.8.8

8.8.44

To begin we will first edit the our internet adaptor, do so run the command:

sudo vi /etc/sysconfig/network-scripts/ifcfg-enpXXX

in our case we ran

 sudo vi /etc/sysconfig/network-scripts/ifcfg-enp0s3

We changed the line

PEERDNS=yes

to:

PEERDNS=no

 

Next we need to edit the resolv.conf file:

 sudo vi /etc/resolv.conf

nameserver 8.8.8.8

nameserver 8.8.4.4

 

How to disable root ssh logins on CentOS 7

If you have a server that’s available over a network it’s generally a good idea to disable root access over ssh.

The reason for this, is that, scripts run attempting to access  your server and these scripts use the root username to try and log in. A simple way to protect yourself is to simply disable root access via SSH.

We will first create a standard user account that we’ll use to administer our system.

Run the command:

useradd darren

Next we’ll set a password for the user

passwd darren

Now let’s give the account admin permissions:

visudo

Add the following line to the file:

darren = ALL=(ALL) ALL

Now lets stop root from accessing the server via ssh:

vi /etc/ssh/sshd_config

Edit the line:

PermitRootLogin yes

To make it read:

PermitRootLogin no

 

Now restart SSH:

service sshd restart.

Next make sure your you can ssh into the account you created:

ssh darren@192.168.123.67

Run a command with sudo to insure you have sudo access

sudo ls

Once you have confirmed you can exit the server knowing that root access is now disabled for the server.