November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Disable Users to login into the server

Suppose we want to take a backup of user’s account. So for that first of all we have to block the user to login into their account to maintain data integrity of user’s backup files. So using below technique we can do that very easily.enjoy !!!

Edit the pam file located in /etc/pam.d/ directory for […]

Time bases iptables rules

f you want to restrict/allow access to certain service on timely basis using iptables.

Use : iptables patch-o-matic extension (pom or p-o-m)

That allows us to match a packet based on its arrival or departure timestamp.

Syntax : iptables RULE -m time –timestart TIME –timestop TIME –days DAYS -j ACTION

–timestart TIME: Time start value […]

Convert RHEL 6.2 to CentOS 6.x

yum clean all# rpm -e subscription-manager

# mkdir /root/centos# cd /root/centos

# wget http://mirror.centos.org/centos/6.3/os/x86_64/RPM-GPG-KEY-CentOS-6# wget http://mirror.centos.org/centos/6.3/os/x86_64/Packages/centos-release-6-3.el6.centos.9.x86_64.rpm# wget http://mirror.centos.org/centos/6.3/os/x86_64/Packages/yum-3.2.29-30.el6.centos.noarch.rpm# wget http://mirror.centos.org/centos/6.3/os/x86_64/Packages/yum-utils-1.1.30-14.el6.noarch.rpm# wget http://mirror.centos.org/centos/6.3/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

# rpm –import RPM-GPG-KEY-CentOS-6# rpm -e –nodeps redhat-release-server# rpm -e yum-rhn-plugin rhn-setup rhn-check rhn-setup-gnome rhnsd (if this is not removing you can do yum remove yum-rhn-plugin rhn-setup rhn-check rhn-setup-gnome rhnsd)# rpm -Uhv –force […]

Email Linux

@reboot /bin/mail -s “$HOSTNAME – rebooted” msn@rmoahn.com <<< “$HOSTNAME has rebooted on $(date)”

 

The ability to know when a system reboot. The tips below will send out an email when a Linux system is reboot. This should indicate to the Administrator that something went wrong with the shutdown. The tips below are for […]

Linux Interview Questions

1 Q. Which command is used to check the number of files and disk space used and the each user’s defined quota

Repquota , it shows filesystem, no. of blocks used, soft and hard limit, no. of files used, soft and hard limits

2 What is the name and path of the main system log

[…]

ssh fash login trick

Edit /etc/ssh/sshd_config and add the following line:

UseDNS no 😎 it will be faster compare to before.

JDK INSTALL CENTOS 6.3

I need to use Java 1.7 So I downloaded jdk-7u17-linux-x64.rpm

when I try to install it, I get the following error.

Unpacking JAR files… rt.jar… Error: Could not open input file: /usr/java/jre1.7.0_17/lib/rt.pack jsse.jar… Error: Could not open input file: /usr/java/jre1.7.0_17/lib/jsse.pack charsets.jar… Error: Could not open input file: /usr/java/jre1.7.0_17/lib/charsets.pack localedata.jar… Error: Could not open […]

How to Install and Configure VNC Server

First you need to check for already installed VNC Server. You can check this by executing following command.

rpm -q vnc-server

If you found message like “package vnc-server is not installe” then you need to install it first by executing following command from root user.

yum install vnc-server

Once VNC Server installed you need to […]

start/stop asterisk

To start asterisk server /usr/sbin/asterisk

To stop asterisk server /usr/sbin/asterisk -r CLI>stop now

To reload asterisk server CLI>reload

To restart asterisk server CLI>restart now

asterisk –rx “stop now”

To show version

asterisk -rx “core show version”

 

asterisk –rx “core show translation”

asterisk –rx “core show codecs”

 

YUM Server in CentOS 6.x / RHEL 6.x

Setup Local YUM Server in CentOS 6.x / RHEL 6.x

(Yum) is a software package manager that installs, updates and removes packages on RPM-based Linux distributions. Yum makes it easier to maintain groups of machines without having to manually update each one using rpm.

Features:

Support for multiple repositories.Simple configuration.Automatic dependency calculation.Fast operation.RPM-consistent behavior.Package […]