How to setup ssh keys

I was trying to setup ssh keys on my linux servers and found this link to be very useful

https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys–2

Credit goes to:  Etel Sverdlov of digital ocean on explaining

Posted in how to, linux | Tagged , , | Leave a comment

Adding CentOS repository to RedHat Enterprise Linux

Don’t have an active Red Hat subscription, but you want to use YUM ??? No problem, you can always add CentOS repository to the yum repos directory to have your red hat linux download and install from CentOS repository.

So when trying to install a package using yum, you should be seeing the following message:

[root@localhost ~]# yum install ksh
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
No package ksh available.
Nothing to do
[root@localhost ~]#

Here is how :
Edit the file  in vi /etc/yum.repos.d/centos.repo   and add the following lines

[centosrepo]
name=Centos Repository
baseurl=http://mirror.cisp.com/CentOS/6/os/i386/
enabled=1
gpgcheck=1
gpgkey=http://mirror.cisp.com/CentOS/6/os/i386/RPM-GPG-KEY-CentOS-6

Now you should be able to install anything using YUM.  Now try yum install ksh  and it should work.
If you have the server behind a proxy server, then you will need to update /etc/yum.conf and add the following lines :

# The proxy server – proxy server:port number proxy=http://myproxy.mydomain.com:3128         —-> your proxy server and port number 
# The account details for yum connections
proxy_username=yum-user       —->  if you need users and password for your proxy
proxy_password=qwerty            —->  if you need users and password for your proxy

Now yum should be able to go access the centos repository.   As always use this at your own risk.

Posted in db2, how to, internet, linux, Misc | Tagged , , , | Leave a comment

Configuring network on RedHat Enterprise Linux Server

Here is  a quick snippet of how to configure network for Red Hat Enterpise Linux for a server.

Here I am trying to configure eth0  to connect to the network.
First we need to ensure that network interface is turned on :

vi /etc/sysconfig/network-scripts/ifcfg-eth0

Find the line that says ONBOOT and ensure it says ONBOOT=yes   If its no then change it to yes…so it will come online when rebooted.

Now lets start the configuration.

Type setup

select network configuration

Screen Shot 2015-03-26 at 11.02.17 AM

 

 

 

 

 

 

 

select device configuration

Screen Shot 2015-03-26 at 11.02.26 AM

 

 

 

 

 

 

select eth0

Normally servers get static ip addresses and if thats the case then remove DHCP .
Fill in the gateway, net mask, DNS information

Screen Shot 2015-03-26 at 11.02.44 AM

 

 

 

 

 

 

Click OK and Save. Then select DNS Configuration . Type in all your DNS information there:

Screen Shot 2015-03-26 at 11.03.05 AM

 

 

 

 

 

 

Click Save and Save & Quit  and Quit.  This will exit the setup screen.
Now that we have configured the network, we got couple of more things to do.
Lets now setup the host files

type  vi /etc/hosts

add a line

<ipaddress>   <hostname>  <hostname.domainname>

eg:

192.1.50.1  redhat1   redhat1.techsatwork.com

Save this file.
Time to restart the network services

type  service network restart 

Ensure that all the services and network (eth0 in this case) started OK
Now lets see if the eth0 is all connected and a link is established

type ethtool eth0

and look for Link Detected : Yes

If you see Yes then that means you are now connected to the network.

Try pinging other servers on the network . Your server should now be connected to internet. One other thing you can optionally do is to stop the firewall. To do that:

type  service iptables save
type service iptables stop
type chkconfig iptables off

 

I hope this helps.  Please test these steps on a non-prod environment first.

**I do not guarantee or accept any consequences from these steps in any circumstances

Posted in db2 | Tagged , , , | Leave a comment

Expanding VM disk in Virtual Box

I have been using VirtualBox for couple of weeks now and I find it pretty stable.  VirtualBox is a free VM engine from Oracle.  It can run pretty much any OS you want as a guest with Windows, Linux , Solaris and OS X as the host.  I have Windows 8 and Ubuntu as a guest running on my OS X.  But last night I ran out of space in my virtual environment. What I found is unlike VMWare , there is no native GUI app to expand the disk. Either you have to download something like Gpart or use the command line. So I thought I will type up something quick to show how to expand  resize the virtual disk.

First of all shutdown the guest OS (virtual image).
Then open a command windows or a terminal window with admin access
Type:  vBoxManage modifyhd <‘full path/vmimage.ext’> –resize <size in MB>
It will take a few seconds to minute to complete.
You should now see the new size on the Oracle VM VirtualBox Manager

In this example, I am resizing the image to 35 GB

virtualbox

 

 

 

Posted in how to, linux, Oracle, unix | Tagged , , , , | Leave a comment