26
Apr
Posted by
admin Category:
Linux Administration
How to check Memory (RAM) usage in Linux OR different ways to check RAM usage in Linux? Memory OR widely known as RAM is known to be one of the important component on the server which make sure the tasks performed on your server are processed fast enough. Higher the availibility of physical memory, more stable is your server during high resource usage processes.
Linux offer various tools to check Memory/RAM usage of your server such as free, top, sar, vmstat etc using which you can deside whether to optimize softwares to use less memory OR whether it’s time to upgrade memory on the server.
1) ‘free’ command: one of the easiest way to check the RAM usage:
free -m
will display physical memory as well as Swap

free -m -t
same as above but it will display the total of physical and swap memory at the bottom.

2) ‘top’ command: The top command displays the real time values of the running system and are continously updated (by default 3 seconds). The two rows “Mem and Swap” displays the total, used and free amount of RAM/Swap. Though the values displayed are in kbs and not human readable, it is just one another way to check the usage.

3) ’sar’ command: is included in the ’sysstat’ package and is not installed by default. sysstat package when installed, prviders ’sar’ command which collects system activity information and saves it in a file before displaying it on a standard output.
sar -r
displays Memory/Buffer/Swap information horizontally.

4) /proc/meminfo file: which displays everything about the RAM on your server.
cat /proc/meminfo

09
Apr
Posted by
admin Category:
Linux Administration
version.c:30:16: error: db.h: No such file or directory
make: *** [version.o] Error 1
If you receive the db.h error message while installaing a package, you are surely missing db and db-devel packages. You need to install the db and db-devel packages using yum.
First search the package using yum.
yum search db
It will list the db as well as db-devel packages, something like:
db4.i386
db4-devel.i386
Or
db4.x86_64
db4-devel.x86_64
Install the appropriate packages depending on whether your server is 32 OR 64 bit. You can find it out with the command
uname -p
If your machine is 64 bit (i.e. x86_64), install the following packages
yum install db4.x86_64
yum install db4-devel.x86_64
05
Apr
Posted by
admin Category:
Linux Administration
The error message “Starting sshd: Privilege separation user sshd does not exist FAILED” is received on restarting the SSHD service. It indicates that the user ’sshd’ does not exist at all. To fix the sshd privileges issue, you need to add the ’sshd’ user on the server.
Edit the file /etc/passwd and add the below line:
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
and the below line in the /etc/group file
sshd:x:74:
You will now be able to restart the sshd service.
# /etc/init.d/sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
Another solution is to disable UsePrivilegeSeparation. Edit the sshd configuration file at /etc/ssh/sshd_config and change
UsePrivilegeSeparation yes
to
UsePrivilegeSeparation no
It is less secure but just another option.