Linux
Is there a command to check which version of linux i am running?
Command to check version and update of OS Solution : lsb_release -d
How to get cpu and memory info in linux
To get cpu and memory info you can use the following command # cat /proc/cpuinfo to know memory info # cat /proc/meminfo
How to Reboot Linux System with init command
You can also use the init command to reboot the system immediately by entering runlevel 6. [root@bigboy tmp]# init 6 The “reboot” command has the same effect, but it also sends a warning message to all users. [root@bigboy tmp]# reboot Broadcast message from root (pts/0) (Sat Nov 6 12:39:31 2004): The system is going down [...]
How to Halt/Shut Down Linux System
The init command will allow you to change the current runlevel, and for a shutdown, that value is 0. Here is an example: [root@bigboy tmp]# init 0 Fedora also has a shutdown command which can also be used to the same effect. It often prompts you as to whether you are sure you want to [...]
How to Determine the Default Boot runlevel
The default boot runlevel is set in the file /etc/inittab with the initdefault variable. When set to 3, the system boots up with the text interface on the VGA console; when set to 5, you get the GUI. Here is a snippet of the file # Default runlevel. The runlevels used by RHS are: # [...]
A Brief to Linux Runlevels
0 /etc/rc.d/rc0.d Halt 1 /etc/rc.d/rc1.d Single-user mode 2 /etc/rc.d/rc2.d Not used (user-definable) 3 /etc/rc.d/rc3.d Full multi-user mode (no GUI interface) 4 /etc/rc.d/rc4.d Not used (user-definable) 5 /etc/rc.d/rc5.d Full multiuser mode (with GUI interface) 6 /etc/rc.d/rc6.d Reboot
What’s an initial RAM disk?
The initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real root file system is available. The initrd is bound to the kernel and loaded as part of the kernel boot procedure. The kernel then mounts this initrd as part of the two-stage boot process to load the [...]
How to see the contents of your MBR
To see the contents of your MBR, use this command: # dd if=/dev/hda of=mbr.bin bs=512 count=1 # od -xa mbr.bin The dd command, which needs to be run from root, reads the first 512 bytes from /dev/hda (the first Integrated Drive Electronics, or IDE drive) and writes them to the mbr.bin file. The od command prints the binary file in [...]
How can boot a specific kernel From the GRUB command-line
From the GRUB command-line, you can boot a specific kernel with a named initrd image as follows: grub> kernel /bzImage-2.6.14.2 [Linux-bzImage, setup=0x1400, size=0x29672e] grub> initrd /initrd-2.6.14.2.img [Linux-initrd @ 0x5f13000, 0xcc199 bytes] grub> boot Uncompressing Linux… Ok, booting the kernel. If you don’t know the name of the kernel to boot, just type a forward slash (/) and press the [...]
How to Set UP an NFS Server – A Step by Step by Guide to Configure NFS Server
This guide explain about to setup and NFS Server .Setting up the server will be done in two steps: Setting up the configuration files for NFS, and then starting the NFS services. Here we are going to use Configure NFS in a RHEL Server. The first step is to configure the exports file where you need to [...]
How to safeguard the servers against SSH Brute Force Attacks
Below are the hardening steps recommended to safeguard the servers against such attacks. Hardening steps 1. Ensure Required Hardening done on the server. –> Enable tcp wrappers –> Enable iptables –> Stop unwanted services –> In case of NFS, only allow export import of folders to specific users & hosts. 2. Direct root access on [...]
How to change TimeZone in your Linux Server – RHEL/Fedora
There are couple of ways by which you can change time zone in your Linux box. One of my server was running EDT time zone actually i need to set it to IST. Â The easiest way to change timezone by typing the following commnad mv /etc/localtime /etc/localtime.old && ln -s /usr/share/zoneinfo/Calcutta /etc/localtime The above example [...]
How to get RHEL Version from command prompt
You can use the following command to get the RHEL version of your runing box. Just go the teminal and type the following command [root@pds6 ~]# cat /etc/redhat-release Red Hat Enterprise Linux ES release 4 (Nahant Update 5)
How to Generate the sendmail.cf File
When you have completed editing your m4 configuration file, you must process it to produce the /etc/mail/sendmail.cf file read by sendmail. This is straightforward, as illustrated by the following example: # cd /etc/mail # m4 /usr/share/sendmail.cf/m4/cf.m4 vstout.uucpsmtp.mc >sendmail.cf This command invokes the m4 macro processor, supplying it the name of two macro definition files to process. m4 processes the files [...]
How to Install sendmail under Linux Box
The sendmail source code is available via anonymous FTP from ftp.sendmail.org. Compilation is very simple bceause the sendmail source package directly supports Linux. The steps involved in compiling sendmail are: # cd /usr/local/src # tar xvfz sendmail.8.9.3.tar.gz # cd src # ./Build You need root permissions to complete the installation of the resulting binary files using: # cd obj.Linux.2.0.36.i586 # [...]
