Tuesday, March 29, 2011

Download RPM packages from a YUM repo without installing in RHEL

Download RPM packages using YUM


This how-to will explain how to download rpm packages from a yum repository without installing them. This will work on Redhat Enterprise Linux 5.x, Fedora and CentOS 5.x.

You need to install yum plugin called yum-downloadonly. This plugin adds a --downloadonly flag to yum so that yum can download the packages without installing/updating them. Following options supported by this plugin:

  • --downloadonly : don't update, just download a rpm file to default yum cache directory /var/cache/yum/.
  • --downloaddir=/path/to/dir : specifies an alternate directory to store packages such as /tmp
Install the yum-downloadonly plugin:

Type the following command to install plugin, enter:

        # yum install yum-downloadonly

Now for downloading rpm packages from an already configured yum repository use the following command:

      # yum update httpd -y --downloadonly

Friday, February 4, 2011

TCP Wrappers: Securing Linux


This how-to describes configuring TCP Wrappers for providing Access Control for the supported services in a Linux box.TCP wrappers are supported by most of the Linux distributions such as Redhat Enterprise Linux, Ubuntu, SUSE, Debian, BSD and UNIX. TCP Wrappers work in the manner of a host-based Access Control List. They will allow host or network addresses to be used as indicators to filter and implement a layer of access control. They additionally extend the capabilities of xinetd-controlled daemons. By using this technique, connection attempts can be logged, restricted, and messages returned. This can add an extra layer of security in your environment. TCP Wrappers also allow run-time reconfiguration without restarting or reloading the services they protect.

Mount NTFS partition in Linux

Mount NTFS partition in Redhat Enterpris Linux / Ubuntu Linux


Enterprise Linux distributions like Redhat Enterprise Linux ( RHEL ) does not provide native support to Windows NTFS partitions. However you may wand to mount a NTFS formated partiiton in your RHEL box. Here is a simple howto to mount NTFS partitions in your RHEL box.

First of all you need to install a couple of packages. You can use YUM for installing the packages. The rpmforge yum repo contains required rpm packages for mounting NTFS partitions on Linux server. The packages are fuse and fuse-ntfs-3g.

              # yum install fuse fuse-ntfs-3g
Yes, you are done now you can mount ntfs partitions on your rhel server using the mount commandas follows.

             # mount -t ntfs-3g /dev/device-name /mount-point

For example:
           # mount -t ntfs-3g /dev/sdb1 /media

This one also works!!!!!

          # mount.ntfs-3g /dev/sdb1 /media
Newer Ubuntu distributions like Ubuntu 10.04 LTS natively supports NTFS partiitons, so in a Ubuntu server you can mount NTFS partition by just using the above mount commnad.



Saturday, December 4, 2010

Install linux in a pendrive.

Install Linux in pen drive
Yea guys, this time I will show you how to install a Linux distribution in your pen drive. You can use this how-to install almost all the Linux distributions including Ubuntu, fedora, CentOS, Debian, KNOPPIX and much more.


What you need:
  • Universal USB Installer tool.
  • Windows XP/Vista/7 to create the USB (Win 98/2K WILL NOT Work! 
  • Fat32 Formatted Flash Drive, 
  • Your Favourite Linux ISO
And of course a PC supporting USB booting to boot from your pen drive.

You can download the Universal USB Installer tool from this link:
 
The Universal USB Installer is a Live Linux USB creator which allows you to choose from a list of Linux distributions and install it in your pen drive. It also allows you to download the required Linux distribution.
The process is just a piece of cake, just run the tool, select your distribution, browse to the distribution, select the flash drive and click install.

Thursday, November 11, 2010

How to reset root password in Ubuntu 10.04 LTS


In this how to we shall discuss how to reset root password in Ubuntu 10.04 LTS. I guess this howto will be of highly useful if you forgot your root password in Linux servers particularly in debian based systems like Ubuntu.

Single User Mode in Ubuntu 
To reset the root password you have to boot to single user mode. Follow to steps below to boot to the single user mode in Ubuntu 10.04 LTS.

Please note that Ubuntu 10.04 LTS use the GRUB 2 as bootloader. The first boot option will be used by GRUB 2 by default and it will be used for booting without waiting for user input. So you need to interrupt the boot process for getting boot menu.

Thursday, October 7, 2010

Set date and time in Ubuntu LTS 10.04

How to set Date and Time in Ubuntu 10.04 LTS Lucid Lynx via command line.

You can use the “date’ command for setting Date in any ubuntu bases distributions.

It is better to take a peek into the man pages of the ‘data’ command via:

                  # man date

The man page of date command in Ubuntu might be a bit confusing for all. Let me explain the process to you!!!

Type in the following command, replacing:

                  nn with two digit month (e.g. 01, 05, 12),
                  dd with two digit day (e.g. 02, 24, 31),
                  hh with two digit hour in 24 hour clock format ( 00, 03, 23), 
                  yy/yyyy with the year in two digit or four digit (optional),
and after a period symbol (.) ss with two digit second (00, 05, 59).

The syntax of the date command is:
            # date nnddhhmmyyyy.ss
or
            # date nnddhhmmyy.ss :- in two digit year format
or      
            # date nnddhhmm :- With minimum required parameters (without year and second)
or         
            # date nnddhhmm.ss :- Without year

Month from 01 to 12 (nn)
Day from 01 to 30/31 (dd)

Hour from 00 to 23 (hh)
Minute from 00 to 59 (mm)
Year in four or two digit format (yy yyyy)
Seconds after the period (.) symbol from 00 to 59 (ss)


Example for specifying 21st september, 2010 6:54:20 PM, you should type in the command

             # date 092118542010.20

To specify set NTP server for automatic time synchronyzation:

            # sudo ntpdate NTP-SERVER_URL_OR_IP

I guess I made it faily simple for updating date and time in Ubuntu Server / Desktop LTS 10.04. Also you can try this command in any of the linux based distributions such as RedHat Enterprise Linux, SUSE Enterprise Linux, Fedora etc.
     

Monday, September 20, 2010

Setting up DNS in Ubuntu 10.04 LTS Lucid Lynx

The DNS setup is also a starignt forward job in Ubuntu 10.04 LTS. Like all other major distributions like Redhat Enterprise Linux, Ubuntu distributions also use the /etc/resolv.conf file for DNS resolving.


To cause your machine to consult with a particular server for name lookups you simply add their addresses to /etc/resolv.conf.

Open the /etc/resolv.conf file in your favoirite editor and specify the DNS server in it.

               # sudo vi /etc/resolv.conf
              
              search example.com
              nameserver 192.168.10.1

Here 192.168.10.1 is my DNS server in my example.com domain. Now if your server does not have the file resolv.conf in your /etc directory, dont worry you can simply create it and edit it as above.

       # touch /etc/resolv.conf

Similarly you can assign static lookups in your /etc/hosts file.

             # sudo vi /etc/hosts


             #
 
             192.168.10.100 test test.example.com

If you specify these host explicitely in the /etc/hosts file then the domain name rsolution will takes place fastly.