Showing posts with label LINUX. Show all posts
Showing posts with label LINUX. Show all posts

Thursday, 5 May 2011

Linux Reset Root User Password

Step 1. Enter grub prompt while booting.

Step 2. If grub has password press "p" and enter the password or select and click "enter" to select the kernel you want to login.





Step 3. Select the line starting with "kernel" and press "e" to edit.




Step 4. Add the word "single" to the end of the line and click escape to save. Press "b" to boot with the modified grub entry.





Step 5. Linux will boot into the shell without any password prompt. Use the command "passwd root" to reset the root user password.



Restart and login with new root password.

Wednesday, 4 May 2011

Linux Custom Kernel Compilation

1. Download the latest kernel from http://www.kernel.org/
Example: wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.x.tar.gz
"tar zxvf linux-2.6.x.tar.gz"
"cd linux-2.6.x"
2. Do an lsmod commad and copy the defalt modules loaded.

"make menuconfig"
3. Select the modules listed from lsmod and make sure those modules are selected in new kernel. Remove all unwanted modules to make the kernel small and custom. Don't remove critical drivers but can remove certain modules that
you are sure not going to be used. Eg: If you are not going to use any wireless device in the server, there is no need to select wirless modules.
4. Make the modules
Modules are parts of the kernel that are loaded on the fly, as they are needed.
"make modules"
5. Install the modules
This will copy all the modules to a new directory, "/lib/modules/<kernelVersion>
"make modules_install"
6. Finalize the installation.
"make install"
*The grub.conf gets updated by the last command. Set the priority of the newly compiled kernel in grub.conf and restart the system to boot in newly compiled kernel.

Sunday, 1 May 2011

Linux getting started. Basic Commands You Should Know.

1. ps                          : ( Process Status ). Displays the currently running processes on Unix/Linux systems.
2. top                        : Displays top cpu processes.
3. df                          : ( Disk Free ). Display the amount of available disk space for filesystems.
4. cd                         : Change Directory
5. ls                          :  Displays list of files.
6. find                       :  Search and find the file from linux filesystem.
7. pwd                      : Display the current working directory.
8. who                      : Show all users logged in.
9. ping                      : Check the network connecivity of the server.
10. ifconfig                : Display the netwok configurations of the server.
11. route                   : Display the routing table informtion.
12. nslookup             : Check the DNS resoltion status.
13. netstat                 : Display all the network connection status.
14. grep                    : Text search utility in linux.
15. cat                      : Display the content of a file.