Thursday, September 24, 2009

How to download & install rpm packages

You should always download rpm packages using the 'wget' command and then install them using the 'rpm' commands. For Example:
  • Go to /tmp directory -- cd /tmp
  • Download the required rpm package -- wget http://url or ftp://url
  • Then install it using rpm commands -- rpm -ivh nameofrpmpackage*
Or you have the choice of doing all this with one command if you trust the source your downloading from or else it is a big security.
  • Download and Install the rpm -- rpm -ivh http://url or ftp://url

Wednesday, September 2, 2009

How to Install OpenSSH on CentOS 5.3 Server

I would like to make it clear that the below instruction were found by me after a considerable search plus I ran into little problem with them so I thought I should do a write up quick as well. I am not trying to steal anything just redoing some instructions as I did during my installation process.

We are going to install OpenSSH, since this is going to be compiled from source, hereafter when ever OpenSSL, OpenSSH, or Zlib have a security issues you can quickly patch without much difficulty. The versions for each of these I am using now are the most current ones, you might have to update them to the latest ones when your installing them.

  1. Download & install zlib by using the following commands:
    1. # cd /tmp
    2. # mkdir -p /opt/zlib
    3. # mkdir zlib1.23
    4. # cd zlib1.23/
    5. # wget http://www.zlib.net/zlib123.zip
    6. # unzip zlib123.zip
    7. # make
    8. # make install prefix=/opt/zlib/
  2. Download & install OpenSSL by using the following commands:
    1. # cd /tmp
    2. # mkdir -p /opt/openssl
    3. # wget http://www.openssl.org/source/openssl-0.9.8k.tar.gz
    4. # tar xvzf openssl-0.9.8k.tar.gz
    5. # cd openssl-0.9.8k
    6. # ./config --prefix=/opt/openssl --openssldir=/opt/openssl
    7. # make
    8. # make test
    9. # make install
  3. Now we are going to install OpenSSH. In the configure section of this installation we'll havet o point to the OpenSSL and Zlib installs we did earlier. We also have want to point to our xauth file, to check the location of the xauth file use the command -- # which xauth -- if this doesnt work then you might have to do -- # find / -name xauth -- if this also doent work then your probably missing the xauth file. If your miss the xauth file you'll have to install it using the following command:
    1. # yum install -xorg-x11-xauth
  4. Download & install OpenSSH by using the following commands:
    1. # cd /tmp
    2. # mkdir -p /opt/openssh
    3. # wget ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-5.2p1.tar.gz
    4. # tar xvzf openssh-5.2p1.tar.gz
    5. # cd openssh-5.2p1
    6. # ./configure --prefix=/opt/openssh --with-ssl-dir=/opt/openssl --with=xauth=/usr/bin/xauth --with-zlib=/opt/zlib
    7. # make
    8. # make install
  5.  We have to make few changes to the sshd init.d script, which is included with CentoOS 5.3. To be able to use this script to start and stop our version of SSH we'll have to change some paths in the /etc/init.d/sshd file. Make sure that the below variables in the file point to correct path of OpenSSH.
    1. # Some functions to make the below more readable
      KEYGEN=/opt/openssh/bin/ssh-keygen
      SSHD=/opt/openssh/sbin/sshd
      RSA1_KEY=/opt/openssh/etc/ssh_host_key
      RSA_KEY=/opt/openssh/etc/ssh_host_rsa_key
      DSA_KEY=/opt/openssh/etc/ssh_host_dsa_key
  6. After you make the above appropriate path changes you'll have to restart SSH, as follows:
    1. /etc/init.d/sshd restart
  7. After this check the version your telnet is showing, it should be the OpenSSH  5.2 you just installed. Give the command as follows:
    1. # telnet Localhost 22
  8. The output should be something similar to:
    1. Trying 127.0.0.1...
      Connected to localhost.localdomain (127.0.0.1).
      Escape character is '^]'.
      SSH-2.0-OpenSSH_5.2
  9. This conculdes our OpenSSH installation on CentOS 5.3 Server.

How to manually mount a USB Drive in CentOS 5.3 Server

  1. Plug in the device
  2. Issue the command --# dmesg -- It should appear as a SCSI device, you should also be able to read the devices vendor and model. It should be something similar to /dev/sdb.
  3. Issue the command --# fdisk -l -- this would determine the partition on the device, usually most of the USB flash and other external drives have only one partition. Your output should be something similar to /dev/sdb1.
  4. Now create a directory by issuing command --# mkdir /mnt/usb -- the directory name should be something easy to remember for you.
  5. Now you'll have to mount the device by using the mount command -- # mount /dev/sdb1 /mnt/usb -- this should mount your device. You can browse to the /mnt/usb directory to view the contents of the USB device.

Installing CentOS 5.3 Server

I am trying to install CentOS 5.3 Server to be able to install Oracle 10g on it, it is an ongoing process as I am not an expert in Linux at all. So I am googling my way through this installation process, so far I have hit a couple of snags but am find solutions for them slowly. The only thing which is bothering me is that I am spending a lot of time on this but I guess you have to spend time in order to learn something new. I am going to post all the steps I'll be taking in order to complete this installation process so if someone else out there is trying to do the same it could be a little easier for them, hopefully.

Wednesday, July 29, 2009

Well just updated to not recieve conformation messages from blogger. Let's see I this works. The phone is setup fine and really nice.
Just set up my phone with blogger and testing now to see if I am able to post this to my blog. Hopefully this works.