Recover root password
If you forgot your root password on Linux, recovering root password can be done
by booting Linux under a specific mode: single user mode.
This tutorial will show how to boot Linux in single user mode when using GRUB
and finally how to change root password.
Entering single user mode:
In GRUB select kernel you want to boot and hit 'e' to edit the line.
Select the kernel line and hit 'e' again to edit thet line.
Now add '1' or write 'single' to the end of line, and press enter
and then press 'b' to boot system.
This will make you the "root" user without asking for a password. Once the
system has booted, you can change the root password using the password
command.
Command to change password: passwd
Looking for Open Source Help??? Here is Blog for it's A-to-Z. Attempt is to crawl along all the codes & concepts
Saturday, August 4, 2007
Friday, August 3, 2007
Debugging Shell Script in Linux.
Bash shell offers debugging options which can be turn on or off using set command.
Execution Trace
set -x : Display commands and their arguments as they are executed.
Verbose Mode
set -v : Display shell input lines as they are read.
Syntax Checking
set -n : Reads all commands, but does not execute them.
You can use above commands in shell script itself:
#!/bin/bash
pwd
ls
# turn on debug mode
set -x
if [ -f "/home/user/file.txt" ]; then
echo "Error reading file: /home/user/file.txt"
exit 1
fi
# turn OFF debug mode
set +x
ls
# more commands.
You can replace standard
#!/bin/bash
with (for debugging)
#!/bin/bash -xv
Subscribe to:
Posts (Atom)