Saturday, March 6, 2010
Sunday, October 18, 2009
Tuesday, July 21, 2009
FIX : Unable to open pty: No such file or directory
While trying to SSH or enter into a VPS from the node, you may get the following error :
Unable to open pty: No such file or directory
or
root@tip~]# vzctl enter 900
enter into VE 900 failed
Unable to open pty: No such file or directory
There is a temporary and permenant fix for this issue.
Temporary Fix :-
Execute the following commands from the node
vzctl exec VEID /sbin/MAKEDEV pty
vzctl exec VEID /sbin/MAKEDEV tty
vzctl enter VEID
Where VEID is the VPS id.
Permanent Fix :-
First temporarly fix the issue and enter into the VPS.
1) vzctl enter VEID
2) Edit the file /etc/rc.sysinit of the VPS
vi /etc/rc.sysini
3) Search for the line /sbin/start_udev and comment it
#/sbin/start_udev
4) Add the following two lines under /sbin/start_udev
#/sbin/start_udev/sbin/MAKEDEV tty/sbin/MAKEDEV pty
5) Reboot the VPS and you are done!
vzctl restart VEID
Thursday, June 18, 2009
Saturday, May 23, 2009
How to enable log rotation on Linux ?
The default configuration file is /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
#compress
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
monthly
minsize 1M
create 0664 root utmp
rotate 1
}
# system-specific logs may be also be configured here.
Service or server specific configurations stored in /etc/logrotate.d directory, for example here is sample apache logrotate configuration file:
less /etc/logrotate.d/httpd
/var/log/httpd/*log {Now you need to set a cronjob for the logrotation to run. crontab -e
monthly
rotate 52
compress
missingok
notifempty
sharedscripts
postrotate
/sbin/service httpd reload > /dev/null 2>/dev/null || true
endscript
}
00 00 * * * /usr/sbin/logrotate -s /home/humanlinux/config/logrotate.status
Cron ensures that the command runs at midnight everyday. The command has three parts. /usr/sbin/logrotate is the path to logrotate. The -s /home/humanlinux/config/logrotate.status option specifies where logrotate keeps its status information. This file has to be writeable by the user running the cron.
run the command
/usr/sbin/logrotate -f /etc/logrotate.conf to begin the log rotationThanks & Regards
tell2humanlinux@gmail.com
How to create a shutdown button on a Linux desktop.
Open your favorite text editor
eg : vi shutdown or
: gedit shutdown
append the following lines
#!/bin/bash
poweroff
save and quit. Move the file location to your desktop
chmod 777 shutdown
chmod +x shutdown (made the file 'shutdown' executable)
Now double click on your 'My Computer" icon to open the file browser window.
goto Edit-->Preferences-->Behavior-->Run executable text files when they are clicked-->close
Now you can double click on the 'shutdown' file to shutdown the machine. You can rightclick on it to choose an appropriate icon for the button.
Friday, May 15, 2009
How to assign swap area in Linux to increase speed?
We can assign swap area in linux either on a partition or a file.
I am creating here swap area using a file.
First we need to create the swap file.
dd if=/dev/zero of=/swapfile bs=1024 count=2000000
this will create a file 'swapfile' under / of size above 2gb
Type the following commands :-
mkswap /swapfile
swapon /swapfile
Now we can add the swap entry on fstab so that on every reboot, system will automatically loads the awap area.
vi /etc/fstab
append the following line to the bottom
/swapfile swap swap defaults 0 0
save and quit
To see the swap usage use the command top
thanks & regards
tell2humanlinux@gmail.com
Thursday, May 14, 2009
How to reset the lxadmin password?
How to put the grub password in linux!
Here are the steps to put the grub password.
1) open the command prompt and type the following commands
2) grub
3) md5crypt
4) type the password
5) copy the encrypted password generated
6) Ctrl c
7) vi /boot/grub/grub.conf
8) paste the following line just above the 'title'
password --md5 "encrypted password here"
9) save and quit. Done.
I have give the sample grub file here.
======================================
#boot=/dev/hdb
default=0
timeout=15
splashimage=(hd1,8)/boot/grub/splash.xpm.gz
hiddenmenu
password --md5 %&mkj89(*$*J)$OO*=*
title CentOS (2.6.18-92.el5)
root (hd1,8)
kernel /boot/vmlinuz-2.6.18-92.el5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.18-92.el5.img
======================================
thanks & regards
tell2humanlinux@gmail.com
Saturday, May 9, 2009
How to install flash player on centos/redhat linux !
Installing the flash player on centos/redhat linux seems to be very difficult sometimes. But the installation is quite simple :). The flash player may not be installed automatically using firefox. While trying install firefox, you may get the error following error " Firefox could not install this item because "install-0zr..rdf" (provided by the item) is not well-formed or does not exist. Please contact the author about this problem."The Screeshot of error is provided. To fix this issue, you need to upgrade/install certain libraries using yum. I have mentioned the commands below.
1. First you need to install those libraries (.i386 and .x86_64):
yum install curl compat-libstdc++-33 glibc nspluginwrapper
2. Once done with the libraries, we need to download the flash player rpm.
mkdir flash
cd flash
download the rpm inside the folder flash.
click here to Download
3. Next we need to execute the command below to install the rpm. This command should be executed inside the folder, where the rpm is downloaded. Ours is in the folder 'flash'.
rpm -ivh flash-plugin-10.0.12.36-release.i386.rpm
(replace with the version of rpm you have downloaded)
4. Close the Firefox and restart it. You should be able to see the flashes hereafter.
thanks & regards
tell2humanlinux@gmail.com
Thursday, May 7, 2009
How to browse files in an ISO image?
Its always easy to do things using the command lines in Linux. To browse files of an ISO image is an easy task in Linux. Open a terminal window and type in the following commands.
sudo mkdir /media/iso
sudo modprobe loop
sudo mount filename.iso /media/iso -t iso9660 -o loop
cd /media/iso
Hereafter you will be able to navigate to the /media/iso folder and see the contents of the ISO image. To unmount the ISO, use the following command:
sudo umount /media/iso
I will explain the commands and options used specificly:
sudo modprobe loop ->loads/ installs the module for loopback file system support
iso9660 -> the file system used by CD roms
-t -> specify the file system type
-o loop -> for additional options while using a loopback filesystem
thanks & regards
tell2humanlinux@gmail.com
How to change the default text editor in ubuntu!
update-alternatives -- config editor
once this command is entered, it asks to enter the no: of our favourite editor. eg:
humanlinux@localhost:~# update-alternatives --config editor
======================================
There are 3 alternatives which provide `editor'.
Selection Alternative
-----------------------------------------------
1 /usr/bin/vim.tiny
2 /bin/ed
*+ 3 /bin/nano
======================================
Just enter the corresponding no: of your favourite editor.
Here i have choosed 1.
======================================
Press enter to keep the default[*], or type selection number: 1
Using '/usr/bin/vim.tiny' to provide 'editor'.
======================================
thanks & regards
tell2humanlinux@gmail.com
Tuesday, May 5, 2009
how to install csf in ubuntu / linux servers!
CSF is a firewall that can be installed on linux based severs to enhance the security. It can be installed even on a server based on cPanel. It can be configured to find out hacking attempts through ssh etc. Can be used for ip whitelisting and blacklisting.
The csf instllation is quite easy. Just follow the documentation I have given below.
1)Create a folder 'csf'
mkdir csf
cd csf
2)Download the csf into this directory and instal.
wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
3)Now we need to test whether we have the required iptables modules in the system
perl /etc/csf/csftest.pl
you may get a result like this
======================================================================================
root@humanlinux-desktop:/home/hlinux/Downloads/csf/csf# perl /etc/csf/csftest.pl
Testing ip_tables/iptable_filter...OK
Testing ipt_LOG...OK
Testing ipt_multiport/xt_multiport...OK
Testing ipt_REJECT...OK
Testing ipt_state/xt_state...OK
Testing ipt_limit/xt_limit...OK
Testing ipt_recent...OK
Testing ipt_owner...OK
Testing iptable_nat/ipt_REDIRECT...OK
RESULT: csf should function on this server
=======================================================================================
Don't worry if you cannot run all the features, so long as the script doesn't
report any FATAL errors
4)You should not run any other iptables firewall configuration script. For
example, if you previously used APF+BFD you can remove the combination (which
you will need to do if you have them installed otherwise they will conflict
horribly):
sh /etc/csf/remove_apf_bfd.sh
5)That's it. You can then configure csf and lfd by edit the files
directly in /etc/csf/*, or on cPanel servers use the WHM UI
csf installation for cPanel is preconfigured to work on a cPanel server with all
the standard cPanel ports open.
csf installation for DirectAdmin is preconfigured to work on a DirectAdmin
server with all the standard DirectAdmin ports open.
csf auto-configures your SSH port on installation where it's running on a non-
standard port.
csf auto-whitelists your connected IP address where possible on installation.
You should ensure that kernel logging daemon (klogd) is enabled. Typically, VPS
servers have this disabled and you should check /etc/init.d/syslog and make
sure that any klogd lines are not commented out. If you change the file,
remember to restart syslog.
See the readme.txt file for more information.
Webmin Module Installation/Upgrade:-
To install or upgrade the csf webmin module:
Install csf as above
Install the csf webmin module in:
Webmin > Webmin Configuration > Webmin Modules >
From local file > /etc/csf/csfwebmin.tgz > Install Module
Uninstallation of CSF :( :-
Removing csf and lfd is even more simple:
On cPanel servers:
cd /etc/csf
sh uninstall.sh
On DirectAdmin servers:
cd /etc/csf
sh uninstall.directadmin.sh
On generic linux servers:
cd /etc/csf
sh uninstall.generic.sh
un-installation Completed
ref: http://www.configserver.com/free/csf/install.txt
thanks & regards
tell2humanlinux@gmail.com
Sunday, May 3, 2009
Baseline Monitoring for troubleshooting in Linux!
- troubleshooting
- essential for healthy systems
- help plan for further growth
- can aide with security
Get free Ubuntu stickers ! :)
Thursday, April 30, 2009
How to monitor a system remotely using conky?

Here are the steps to remotely monitor a linux machine using conky. The example here is done on an Ubuntu Box.
1)Install conky on the system(remote server/system) you need to monitor
sudo apt-get install conky
2)Then install the "xauth" program onto the system(remote server/system) tunneling X (file server)
sudo apt-get install xauth
3)Then we have to edit the ssh server side file /etc/ssh/sshd_config and make sure "X11Forwarding yes" is enabled
4)Then from your local system , you can log into the remote system via SSH with the -X flag. Example:
ssh -X username@192.168.1.100
the user name should be the user of the (remote server/system)
5)once you are logged-in to the remote system, just type conky on the command prompt. You will be able to see the services like:-
- uptime
- frequency
- RAM usage
- SWAP usage
- CPU usage
- Processes
- File systems:
- Networking:
- and currently running processes of the remote system
thanks & regards
tell2humanlinux@gmail.com

