Monthly Archives: October 2013

How to run Tomcat on port 80 in Linux

By default Tomcat’s HTTP connector listens on port 8080. Changing to port 80 in Linux environment is a tricky issue, since by default listening on any port under 1024 require a privileged user, and for security considerations it is not … Continue reading

Posted in Linux/CentOS | Leave a comment

How to label partitions in Linux

In linux, to label a partition, there are 3 tools that can be used. The tools are e2label, tune2fs and mke2fs. To use e2label to label the second partition of the first hardisk with label DATA: # e2label /dev/sda2 DATATo use … Continue reading

Posted in Linux/CentOS | 1 Comment

How to encrypt a tar file using openssl

In some cases, we may have to send our passwd information to some of your colleagues. Instead of sending them in plain text, you can use tar & openssl combination to encrypt that data. Here is how it can be … Continue reading

Posted in Linux/CentOS | 1 Comment

How to set up CVS Server in Linux

Let us assume following in this article: server: server.example.com   client: client.example.com Goal: user alex can use the CVS on server.example.com (assumption: alex has an account as “alex” on server.example.com) Steps: 1. install cvs and xinetd on the server $yum install … Continue reading

Posted in Linux/CentOS | 6 Comments

How to set RADIUS client for Linux

Install gcc and pam-devel [root@server~]# yum install -y gcc pam-devel  Download pam_radius  [root@server~]# wget ftp://ftp.freeradius.org/pub/radius/pam_radius-1.3.17.tar.gz  Extract the zip file and compile the source  [root@server~]# tar xfz pam_radius-1.3.17.tar.gz  [root@server~]# cd pam_radius-1.3.17 [root@server~]# make  Copy shared library  [root@server~]# cp pam_radius_auth.so /lib/security/  Edit … Continue reading

Posted in Linux/CentOS | Leave a comment

FTP Error – 500 OOPS: cannot change directory:/home/user

  If you have the ftp error below with SELinux enabled, you can disable SELinux to resolve the issue.   [root@localhost ~]# ftp localhost Connected to localhost (127.0.0.1). 220 (vsFTPd 2.2.2) Name (localhost:user): user 331 Please specify the password. Password: … Continue reading

Posted in Linux/CentOS | Leave a comment

SSH hardening on Linux Servers

SSH server configuration file is located in /etc/ssh/sshd_conf. You need to restart the SSH service after every change you make to that file in order for changes to take effect. Change SSH listening port By default, SSH listens for connections … Continue reading

Aside | Posted on by | 4 Comments

How to enable ssl or https on tomcat server

If you are running tomcat server that runs only on HTTP, follow the 2 easy steps mentioned below, to configure tomcat for SSL. 1. Create Keystore using Java keytool First use the keytool to create a java keystore as shown … Continue reading

Posted in Linux/CentOS | Leave a comment

Pluggable Authentication Modules(PAM) in Linux

Every time you log into a Linux system, you’re using the Pluggable Authentication Modules (PAM) behind the scenes. PAM simplifies Linux authentication, and makes it possible for Linux systems to easily switch from local file authentication to directory based authentication … Continue reading

Posted in Linux/CentOS | Leave a comment

How to install OpenVZ Server in Linux

“OpenVZ is container-based virtualization for Linux. OpenVZ creates multiple secure, isolated containers on a single physical server enabling better server utilization and ensuring that applications do not conflict. Each container performs and executes exactly like a stand-alone server; a container … Continue reading

Posted in Linux/CentOS | Leave a comment

Sendmail “cannot open /etc/mail/local-host-name”: world writable directory

/etc/mail/sendmail.cf: line 91: fileclass: cannot open ‘/etc/mail/local-host-names’: World writable directory e.g. [root@test ~]# mailq /etc/mail/sendmail.cf: line 91: fileclass: cannot open ‘/etc/mail/local-host-names’: World writable directory /etc/mail/sendmail.cf: line 588: fileclass: cannot open ‘/etc/mail/trusted-users’: World writable directory As Error clearly indicate that mentioned … Continue reading

Posted in Linux/CentOS | Leave a comment

SSHFS in Linux

SSHFS stands for (Secure SHell FileSystem) client that enable us to mount remote filesystemand interact with remote directories and files on a local machine using SSH File Transfer Protocol(SFTP). SFTP is a secure file transfer protocol that provides file access, … Continue reading

Posted in Linux/CentOS | 1 Comment

How to DROP all MySQL tables from the command line

If you want to drop all the tables in a database, but didn’t have access to a UI like phpMyAdmin, then the easiest thing to do would have been to drop the entire database then re-create it. But If you … Continue reading

Posted in Linux/CentOS | 1 Comment

How To Remove Packages With RPM “Error: … Specifies Multiple Packages ”

Sometimes when you want to remove any packages installed on Server using RPM, you will get errors as “error: “” specifies multiple packages “. To get rid of this error, you have to use “–allmatches” option available with RPM command. … Continue reading

Posted in Linux/CentOS | Leave a comment

How to Read MySQL Binary Log Files (BinLog) with mysqlbinlog?

MySQL database server generates binary log files for every transaction to the databases, provided administrator does not disable or comment out the “log-bin” parameter in my.cny configuration file. The binary log files are written in binary format. Although the binary … Continue reading

Posted in Linux/CentOS | Leave a comment

/dev/null: Permission denied

If you got this  error message ,do the Following things to fix it. It doesn’t requires any reboot and it wont effect to production.  testmachine11:~ # ls -ld /dev/null crw——- 1 root root 1, 3 Apr 22  2012 /dev/null   … Continue reading

Posted in Linux/CentOS | Leave a comment

How to recover deleted /etc/passwd file in linux

For this you have to following steps, – Start GRUB on boot (press ESC while booting) – Press e over (recovery mode) – Press e over the line beginning with kernel – Press Space bar and enter “init=/bin/bash” – Press … Continue reading

Posted in Linux/CentOS | Leave a comment

Linux Tuning Parameters

Kernel To successfully run enterprise applications, such as a database server, on your Linux distribution, you may be required to update some of the default kernel parameter settings. For example, the 2.4.x series kernel message queue parameter msgmni has a … Continue reading

Posted in Linux/CentOS | Leave a comment

Quit from shell without saving into history

There are many instances when we want to quit from shell without saving any command in history. We might have run by mistake some rookie command and you dont want to disclose it to others. Run the command   #kill … Continue reading

Posted in Linux/CentOS | 2 Comments

VPN Tab Disabled in Gnome Network Manager in linux

The Gnome NetworkManager has pluggable support for VPN software, including Cisco compatible VPNs (using vpnc), openvpn, and Point-to-Point Tunneling Protocol (PPTP). You need to simply install the NetworkManager VPN plugin and configure the user’s machines with the VPN’s settings. The … Continue reading

Posted in Linux/CentOS | Leave a comment

How to disable usb port in linux

To disable USB port on the machine, you can edit the grub.conf # vim /boot/grub/grub.conf   Add the kernel parameter kernel /vlinuz ….. rhgb quiet nousb   Reboot your system and you will notice all your usb ports disabled

Posted in Linux/CentOS | Leave a comment

Rebuild journal on an ext3 file system in Linux

You may encounter problems with journal in file system. It means that, your system will boot normally as it should. But after sometime, the partitions will be remounted as Read-Only file system since kernel is unable to read the blocks … Continue reading

Posted in Linux/CentOS | Leave a comment

How to enable remote access To Mysql database server?

By default remote access to MySQL database server is disabled for security reasons. However, some time you need to provide remote access to database server from home or a web server. MySQL Remote Access You need type the following commands … Continue reading

Aside | Posted on by | Leave a comment

Routing in Linux

Basic Linux routing Add a route to a network #route add -net network/mask gw default-gateway Example #route add -net 10.10.10.0/24 gw 192.168.0.1 Adding default gateway #route add default gw default-gateway Example #route add default gw 192.168.0.1 Adding a route to … Continue reading

Posted in Linux/CentOS | Leave a comment

How to recompile kernel in LInux

Step1: Before compiling the kernel the following packages should be installed in order to compile kernel a. Glib-devel b. Gcc c. Ncurscs-devel d. Binutils e. Kernel-sourcecode Step2: Download the latest kernel from http://www.kernel.org/ and copy the.tar.bz2 file to /usr/src folder [root@server~]#cd /usr/src  [root@server~]#wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.25.4.tar.bz2 Step3: Now unzip the compressed kernel in the same … Continue reading

Posted in Linux/CentOS | Leave a comment

Linux File Systems: Ext2 vs Ext3 vs Ext4

ext2, ext3 and ext4 are all filesystems created for Linux. This article explains the following: High level difference between these filesystems. How to create these filesystems. How to convert from one filesystem type to another.  Ext2 Ext2 stands for second … Continue reading

Posted in Linux/CentOS | Leave a comment

/usr/bin/ld: cannot find -lc error in RHEL6

You need to install the glibc-static package. It contains the C library static libraries for -static linking. You don’t need these, unless you link statically, which is highly discouraged. But mini_sendmail is specially used for chrooted setup. To install this … Continue reading

Posted in Linux/CentOS | Leave a comment

VSFTPD cap_set_proc and dead but subsys locked errors

#1: 500 OOPS: cap_set_proc error After successful user login vsftpd will display an error: $ ftp ftpserver.xyz.com Output: Connected to ftpserver.xyz.com. 220 (vsFTPd 2.0.5) Name (localhost:alex): alex 331 Please specify the password. Password: 230 Login successful. Remote system type is … Continue reading

Posted in Linux/CentOS | Leave a comment

How to set TMOUT To Automatically Log Users Out

For security reasons it is sometimes recommended to force logout of a user after certain minutes of inactivity. Here it is how to do it: Linux bash shell allows you to define the TMOUT environment variable. Set TMOUT to automatically … Continue reading

Posted in Linux/CentOS | Leave a comment

How to Install multiple tomcat in Linux

This article discusses how to install Apache Tomcat 6.0 (6.0.18) on  Linux . Additionally it shows how to setup multiple Tomcat JVM instances on a single Linux server. Installing Java Runtime Environment To run Tomcat, you need Java Standard Edition … Continue reading

Posted in Linux/CentOS | Leave a comment