Wednesday, August 11, 2010

Install and Configure Telnet : Fedora

STEP 1:Install Telnet package

yum install telnet-server
yum install xinetd

STEP 2:
Edit the following and find the line for disable and change it from the value "yes" to "no".

# vim /etc/xinetd.d/telnet

STEP 3:
Restart the xinetd deamon

STEP 4:
Inorder to configure Telnet for root logins

Simply edit the file /etc/securetty and add the following to the end of the file:

pts/0
pts/1
pts/2
pts/3
pts/4
pts/5
pts/6
pts/7
pts/8
pts/9
This will allow up to 10 telnet sessions to the server as root

Friday, August 6, 2010

Command to search package name in Linux

Ubuntu:

#apt-cache search package name

Fedora:

#yum list package name

Thursday, July 29, 2010

How to unmount while device is busy

Sometimes You might get the following error messages while unmounting
# umount /dev/sda2/
umount: /dev/sda2:device is busy
Try the below command
# fuser -m /dev/sda2
It will show the process id which is causing it
If you get the process id then you can umount!!!!!!

Sunday, July 25, 2010

Fedora:How to restore deleted desktop panel

STEP 1:Make a directory
[antony@localhost ~]$ mkdir bak
STEP 2:Move the following files
[antony@localhost ~]$ mv {.gnome*,.gconf*} bak/
STEP 3
:Reboot

Enable root login in GUI Fedora

STEP 1:Open the terminal and edit
vim /etc/pam.d/gdm
Comment the following line #auth required pam_succeed_if.so user != root quiet
STEP 2: Also Edit /etc/pam.d/gdm-password
Comment the following line #auth required pam_succeed_if.so user != root quiet
Done...

Thursday, July 15, 2010

Disabling iptables in LINUX

For Fedora,Try the following commands
#service iptables save
# service iptables stop
# chkconfig iptables off
For other Linux distributions
# iptables -F
# iptables -X
# iptables -t nat -F
# iptables -t nat -X
# iptables -t mangle -F
# iptables -t mangle -X
# iptables -P INPUT ACCEPT
# iptables -P OUTPUT ACCEPT

Thursday, May 20, 2010

Compiling Linux Kernel:Ubuntu

STEP 1: Download latest kernel from http://kernel.org
STEP 2:Extract the downloaded tar file
#tar -xvf linux-2.6.XXXX -C /usr/src#cd /usr/src
STEP 3:Configure Kernel
Make sure development tools "gcc compiler " got installed
#apt-get install gcc
Now type the following command and we can select different options as per our need#make menuconfig
STEP 4:Compilation of kernel
Initially create a compressed kernel image,
#make
Now start compiling to kernel modules
#make modules
Install kernel modules
#make modules_install
STEP 5:Install Kernel
#make install
The above command will install three files into /boot directory
->System.map-2.6.xx
->config-2.6.xx
->vmlinuz-2.6.xx
STEP 6:Creating initrd image
Create using following commands
# cd /boot# mkinitrd -o initrd.img-2.6.xx 2.6.xx
STEP 7:Modify Grub configuration file - /boot/grub/menu.lst
STEP 8:Update the grub
# update-grub
STEP 9:Reboot

Monday, April 12, 2010

Configuring Apache with SSL(WindowsXP)

Easy Steps to configure Apache with SSL
STEP1:
Install the following
i>jdk
ii>Apache Tomcat
STEP 2:
After installing the above softwares edit the following path,in System Variables
Go to,Mycomputer->RightClick->Prpoerties->Advanced->EnvironmentVariables->Under SystemVariables..Add the following variables
i>VariableName = classpath
VariableValue =c:\ProgramFiles\ApacheSoftwareFoundation\lib\servlet-api.jar
ii>VariableName = Path
VariableValue = c:\ProgramFiles\jdk*\bin
iii>VaribleName = JAVA_HOME
VariableValue = c:\ProgramFiles\Java\jdk*

iv>VariableName = CATALINA_HOME
VariableValue = c:\ProgramFiles\ApacheSoftwareFoundation\Tomcat*
STEP 3:

Now generate a key..
Open command prompt
c:\ProgarmFiles\Java\Jdk*\bin >keytool -genkey -alias Tomcat -keyalg RSA
It will prompt for keystore password :Enter any password and then foolow the instructions and finally enter yes and press enter.
Now a .keystore file will be generated in the user profile folder under c:\Document and settings\user
STEP 4:
Edit the server.xml file from the following location
c:\programFiles\ApacheSoftwareFoundation\Tomcat*\conf\Server.xml
Uncomment the line that starts with Connector = 8443
and also add the following
keystoreFile="Path were keystore file is generated"
keystorePass="Password that you entered while generating key"
STEP 5:
now start the apache web server and try
https://localhost:8443/

It should work

Thursday, April 8, 2010

How to add a linux machine to Windows domain

This Article shows how to add a Ubuntu machine to Windows Domain
Here we are going to use a open source Tool (Likewise).
STEP1:
Install the package
#apt-get install likewise-open5
STEP 2:
Go to Terminal
#domainjoin-cli join domainname Administrator
Example:
domainjoin-cli join antonysunny.com Administrator
In the above example domainname = antonysunny.com
It will prompt for Admin Password which has permission to join to domain
Make sure the system gets restarted
STEP 3:
Inorder to login Enter the username as domain\user
Example:ANTONYSUNNY\user
In the above example ANTONYSUNNY is the NETBIOS name for the domain name

Done
TROUBLESHOOTING:
->Inorder to make likewise-open use a default domain add the following to /etc/samba/lwiauthd.conf
winbind use default domain = yes
->Restart /etc/init.d/likewise-open restart
->Inorder to unjoin from domain Go to terminal
#domainjoin-cli leave

Wednesday, March 31, 2010

How to mount Vmware virtual disk(.vmdk) in Windows XP

STEP 1:
Download Vmware mount utility from Vmware website or from any other source
Install the Utility following the onscreen instructions
STEP 2:
Now in your Windows machine Go to Command prompt
Type cd "\Program Files\Vmware\Vmware DiskMount Utility"
STEP 3:
Now execute the following command
vmware-mount j: "D:\WindowsXpProfessional\WindowsXpProfessional.vmdk"

The above commands the .vmdk to Drive j

Or Try using Vmware Disk mount GUI a free utility

Done..

Fix Grub in Fedora

Reinstalling grub
STEP 1:
->Boot using installation disc
->choose rescue mode
->The system existing will be mounted on /mnt/sysimage
STEP 2:
Now execute the following commands
#chroot /mnt/sysimage
#grub-install /dev/sda //Assuming fedora is installed in /dev/sda

Enjoy!!!!

Tuesday, March 30, 2010

How to access windows share using Linux

STEP 1:
Share a folder in Windows and give permissions for a user
In my Example username=test and password=test@123
STEP 2:
Use the mount command as follows
#mount -t cifs //ipaddress of windows machine/Shared folder /mnt -o username=test,password=test@123
Above command mounts the shared folder to /mnt
STEP 3:
Now access the shared folder using cd /mnt ; ls -l

Friday, March 26, 2010

DHCP Server Configuration in UBUNTU

STEP 1:
Install the dhcp package
#apt-get install dhcp3-server
STEP 2:
DHCP server can be configured in two ways
i>Address Pool
ii>Mac Address

STEP 3:

Inorder to configure DHCP server 2 files has to be edited

i>/etc/default/dhcp3-server

ii>/etc/dhcp3/dhcpd.conf

Editing /etc/default/dhcp3-server

This file is edited inorder to show which network interface is been used for DHCP listening

Example:

Find this line INTERACES = "eth0" which will be default,Incase if your using different interface like eth1 or eth2 change eth0 to the interface we are using.

STEP 4:

How to edit /etc/dhcp3/dhcpd.conf

Using Address Pool method

default-lease-time 600;

max-lease-time 7200;

option subnet-mask 255.255.255.0;

option broadcast-address 192.168.1.255;

option routers 192.168.1.254 ; //default gateway being used

option domain-name-servers 192.168.1.1,192.168.1.2;

option domain-name "

subnet 192.168.1.0 netmask 255.255.255.0 {

192.168.1.10 192.168.1.200;

}

Using MAC Address method

This method can be used to reserve fixed IP address for machines depending on mac address

Add the following to the above mentioned

host server1{

hardware ethernet

fixed-address

}

STEP 5:

Restart DHCP service

#/etc/init.d/dhcp3-server restart

Also start the networking service

#/etc/init.d/networking restart


Thursday, March 25, 2010

How to set up linux as a ROUTER

Setting up Linux machine as a ROUTER
STEP 1:

Consider 2 interfaces: eth0 and eth1
eth0 //connecting to internet //Static IP assigned by ISP
eth1 //connexcting to LAN //Assigned Private ip 192.168.XXX.XXX
STEP 2:
Turn on ip forwarding
Edit /etc/sysctl.conf
Add the following
net.ipv4.ip_forward = 1
STEP 3:
Restart Network services by the following
#service network restart
STEP 4:
Set up IP forwarding and Masqerading by the following:
#iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
#iptables --append FORWARD --in-interface eth1 -j ACCEPT

STEP 4:
Assign the ipaddress of eth1 as the default gateway for the clients

Monday, March 22, 2010

Assign Static Ip in Ubuntu

STEP 1:
Add the following to the below mentioned file and save the file
Edit /etc/network/interfaces
iface eth0 inet static
address 192.168.1.16 //Any IP address
netmask 255.255.255.0
gateway 192.168.1.1
STEP 2:
Inorder to load the new configuration we need to restart the computer or
Try the below commands
ifdown eth0
ifup eth0

Monday, February 22, 2010

Important Directories in Linux

Home Directories : /root, /home/
User Executables : /bin,/usr/bin,/usr/local/bin
System Executables : /sbin,/usr/sbin,/usr/local/sbin
Mount points : /mnt
Configuration files : /etc
Temporary files : /tmp
Kernel and Boot loader files : /boot
Server Data : /var,/srv
Shared Libraries : /lib,/usr/lib,/usr/local/lib

Thursday, February 18, 2010

How To : Linux LVM (Logical Volume Manager)

This Article shows on how to create a logical volumes on Linux
STEP 1:(Create Partitions)
Here we are considering a physical Hard Disk (dev/sda)
Using fdisk command we are going to partition the /dev/sda into /dev/sda1 and /dev/sda2
Eg:fdisk /dev/sda
We created 2 partitions /dev/sda1 and /dev/sda2
STEP 2:(Create Physical Volumes)
Use the pvcreate command to create physical volumes# pvcreate /dev/sda1# pvcreate /dev/sda2
Use the pvdisplay command displays all physical volumes on your system
STEP 3:(Create Virtual group)
Here I am going to create a new Vitual group
# vgcreate mynew_vg /dev/sda1
To include both the partitions as a Single Virtual group,
# vgcreate mynew_vg /dev/sda1 /dev/sda2
Or else if you want to extend the same virtual group to other partitions
# vgextend mynew_vg /dev/sdb2
STEP 4:(Create Logical Volumes)
create a logical volume of size 1000 MB -L 1000create a logical volume of size 5 GB -L 5G
# lvcreate -L 1000 -n vol01 mynew_vg # lvcreate -L 5G -n vol02 mynew_vg
To display Logical volumes use the command lvdisplay
STEP 5:(Create File systems on logical volumes)
# mkfs.ext3 /dev/mynew_vg/vol01# mkfs.ext3 /dev/mynew_vg/vol02
STEP 6:(Edit fstab)
Edit /etc/fstab
Add the the created logical volumes
Eg:/dev/mynew_vg/vol02 /mnt/lvm ext3 defaults 0 2
STEP 7:(Mount LVM)
Make the directory where we want to mount as mentioned in fstab#mkdir /mnt/lvm
#mount -a
or
#mount /dev/mynew_vg/vol02 /mnt/lvm

Wednesday, February 17, 2010

Set up FTP server in Linux

STEP 1:
Install the package
$ sudo apt-get install vsftpd
STEP 2:
Edit /etc/vsftpd.conf
Disable anonymous access:
Change the "anonymous_enable" setting to NO
Change the "local_enable" setting to YES.

STEP 3:
Restart the services
$/etc/init.d/vsftpd restart

TROUBLESHOOTING:
Inorder to enable root login for FTP clients(Eg:File zilla)
We need to edit /etc/ftpusers
Comment the root user and restart the services.

Setting up TFTPD in Linux

STEP 1:
Install tftpd and related packages.
$ sudo apt-get install xinetd tftpd tftp
STEP 2:
Create /etc/xinetd.d/tftp and put this entry:
service tftp
{protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}
STEP 3:
Make /tftpboot directory
$ sudo mkdir /tftpboot
$ sudo chmod -R 777 /tftpboot
$ sudo chown -R nobody /tftpboot
STEP 4:
Start tftpd through xinetd
$ sudo /etc/init.d/xinetd start
STEP 5:
Testing. Tranfering file hda.txt from 192.168.1.100 (Client using tftp) to 192.168.1.101(Server 192.168.1.101).Get an example file to transfer (eg. hda.txt)
$ touch /tftpboot/hda.txt
$ chmod 777 /tftpboot/hda.txt
$ tftp 192.168.1.101tftp> put hda.txt
Sent 722 bytes in 0.0 secondstftp> get tftp>quit

TROUBLESHOOTING:
1:"Error 1: File could not be found"The above mentioned error might occur if we try to use "put" command
In that case try creating the same file name in the other computer also,then it will over write.

Sunday, February 14, 2010

Accessing Fedora LVM in Ubuntu

Scenario:While trying to mount a LVM created in fedora on UBUNTU,you might get an error like"Unknown filesystem type"
STEP 1:
Install the following package,
[root@localhost ~]#apt-get install lvm2
STEP 2:
Load the necessary module,
[root@localhost ~]#modprobe dm-mod
STEP 3:
Scan your system for LVM volumes and identify in the output the volume group name that has your Fedora volume (mine proved to be VolGroup00):
[root@localhost ~]#vgscan
STEP 4:
Activate the volume
[root@localhost ~]#vgchange -ay VolGroup00
STEP 5:
Find the logical volume that has your Fedora root filesystem (mine proved to be LogVol00):
[root@localhost ~]#lvs
STEP 6:
Create a mount point for that volume:
[root@localhost ~]#mkdir /mnt/data
STEP 7:
Mount it:
[root@localhost ~]#mount /dev/VolGroup00/LogVol00 /mnt/data

Now copy the datas

Wednesday, February 10, 2010

Fedora:Takes long time to boot in GUI

The Scenario was that a Fedora machine was taking long time to boot into GUI,but it logs into Terminal very fast
STEP 1:
Try checking the logs from,
cat /var/log/messages
It will show the reason,in my case it was showing fails to authenticate to LDAP
STEP 2:
Go into authentication configuration,by typing the follwing command,
[root@localhost]#setup
Then go to "Authentication Configuration"
Disable all the unwanted authentications like NIS,LDAP etc according to your use

Now it should work fine...

Sunday, February 7, 2010

configure samba:Interoperability between windows and linux

STEP 1:
Before making changes to samba configuration file,back up the original samba config. file
Eg:cp /etc/samba/smb.conf /etc/samba/smb.conf.original
STEP 2:
Edit smb.conf
Eg:vim /etc/samba/smb.conf
Scrol down to the section SHARE DEFINITIONS
For example if you want to share your home folder,Add the following lines
Eg:[home]
path = /home
writable = yes
browseable = yes
valid users = root
guest ok = no

Then save the file by pressing "Esc" ":""wq"
STEP 3:
Now add samba users by using the command
Eg:smbpasswd -a root
enter password

STEP 4:
In Fedora,Restart the samba services
Eg:service smb restart
In Ubuntu:
Eg: /etc/init.d/samba restart

STEP 5:
Now go to your windows machine
Goto Start->Run->\\ipaddress of the linuxmachine
STEP 6:
Incase any issues like access denied try disabling the firewall and SE linux management

Friday, February 5, 2010

Installing JDK 1.5 on Fedora

STEP 1:
Download "jdk-1_5_0_21-linux-i586-rpm.bin" file from Java Website
Now change the permission of the downloaded file to 755 like this:chmod 755 jdk-1_5_0_21-linux-i586-rpm.bin
STEP 2:
Then run it:./ jdk-1_5_0_21-linux-i586-rpm.bin
You need to type "yes" to indicate your acceptance to their agreement and the installation will complete on its own
STEP 3:
Now you need to find the actual location of your JDK installation and indicate to Fedora to accept your choice.
Type the following
updatedb;locate javac grep bin

You will see an entry like this:
/usr/java/jdk1.5.0_21/bin/javac

Here /usr/java/jdk1.5.0_21 is the actual JAVA_HOME for your machine. Note this as you will need it to run the future commands.
STEP 4:
Now you need to run the alternatives command to instruct Fedora to recognize Sun's JVM
/usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.5.0_21/bin/java 100
/usr/sbin/alternatives --install /usr/bin/jar jar /usr/java/jdk1.5.0_21/bin/jar 100
/usr/sbin/alternatives --install /usr/bin/javac javac /usr/java/jdk1.5.0_21/bin/javac 100
STEP 5:
Finally you should configure alternative to use Sun's JVM as the default JVM. To do this type:
/usr/sbin/alternatives --config java
Select /usr/java/jdk1.5.0_21/bin/java as default
/usr/sbin/alternatives --config javac
Select /usr/java/jdk1.5.0_21/bin/javac as default
STEP 6:
Add the following path in .bashrc
export PATH=$PATH:/usr/java/jdk1.5.0_21/jre/bin
Append the path in .bash_profile
/usr/java/jdk1.5.0_21/jre/bin:/usr/bin/java/jdk1.5.0_21/bin
STEP 7:
Type java –version
java version "1.5.0_21"
Java(TM) 2 Runtime Environment, Standard Edition(build 1.5.0_21-b01)
Java HotSpot(TM) Server VM (build 1.5.0_21-b01, mixed mode)

Thursday, January 14, 2010

Unable to install Fedora through GUI in Vmware

Hi..Friends..There are instances were we wont be able to do GUI installation of fedora through vmware...
STEP 1:
Install vmware and then create the new virtual machine..
STEP 2:
Then right click on the new virtual machine->go to settings and then increase the memory..and then try installing ...It should work fine..

GUI Package Manger for fedora (yumex)

Most people wanted to know is there a GUI package manager for fedora something like Synaptic manager in Ubuntu..Yes we do have yumex(known as yum extender)
Here we go...
STEP 1:
Install the following package
Eg: sudo yum install yumex
STEP 2:
After installation go to terminal and type the following command:
yumex
=========%%%%%%%%%%%%%%%============

Friday, January 8, 2010

NFS setup in ubuntu

NFS server configuration in Ubuntu
==========================

STEP 1:
Install packages
sudo apt-get install portmap nfs-kernel-server
STEP 2:
Edit /etc/exports
For example if you want to share your home folder
Eg: /home 192.168.0.0/255.255.255.0(rw,sync,no_subtree_check)
The above shares /home to all clients in the private network falling within the designated ip address range
STEP 3:
After editing the exports file,run
sudo exportfs -ra
STEP 4:
Then restart the services,
sudo portmap restart
sudo nfs-kernel-server restart

NIS Client set up
============

STEP 1:
Install the packages
Eg:sudo apt-get install portmap nfs-common
STEP 2:
You should try and mount it now.
Eg:sudo mount 192.168.1.50:/home /home/backup
In the above example 192.168.1.50 is the NFS Server Ip followed by th efolder that's been shared and then followed by the destination(ie the destination where you want to mount)

===##############======

NIS server set up in Fedora

Setting up NIS Server in Fedora
========================
STEP 1:
Install a package called ypserv
Eg: yum install ypserv
STEP 2:
Setting the NIS Domain Name
Edit the file: /etc/sysconfig/network and add the following line to it:
NISDOMAIN=somedomainname

Eg: NISDOMAIN=LINUX-NIS.com
STEP 3:
Initializing NIS files
You can do this using the following command:
/usr/lib/yp/ypinit –m
STEP 4:
Updating the NIS files
From now on, every time you add a user, delete a user; you have to update the NIS database. You can do this using the command:

make –C /var/yp
STEP 5:
Starting the NIS server
/etc/init.d/ypserv start
The server is now ready to handle authentication requests from the clients