Edit GRUB and reset root password, But now we are looking how can set password for grub ??

Posted on Updated on

Login as root
Enter grub mode:
# grub

Use md5crypt to encrypt password:
grub> md5crypt
Password: ******
Encrypted: $1$jxcdN0$hVHViq1aiPf8FziuGJGZp0

Copy down encrypted password:

Exit grub mode:
grub> quit

Modify file /etc/grub.conf:

kate /etc/grub.conf or vi /etc/grub.conf

Insert encrypted password in between “splashimage…” and “title…”:

password –md5 $1$jxcdN0$hVHViq1aiPf8FziuGJGZp0
title BIZ DESK (2.4.20-8elx)

Save edited file

*If you see “#”, means that you have to type the command in the “Terminal” program found on desktop
*Do not include the “#” while executing the command in the “Terminal” program

Now GRUB commands can only be executed at the boot prompt after pressing P and entering the password. However, users can still boot all operating systems from the boot menu.

To prevent one or several operating systems from being booted from the boot menu, add the entry lock to every section in menu.lst that should not be bootable without entering a password.

title CentOS (2.6.18-194.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.el5 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.18-194.el5.img

After rebooting the system and selecting the Linux entry from the boot menu, the following error message is displayed:

Error 32: Must be authenticated

Press Enter to enter the menu. Then press P to get a password prompt. After entering the password and pressing Enter, the selected operating system (Linux in this case) should boot.


How to block USB access in Linux ????

Posted on Updated on

Disabling USB storage on a Linux  platform is not more complicated:

Login as root privilege
#echo ‘install usb-storage : ‘ >> /etc/modprobe.conf
#modprobe -r usb_storage

That’s it …

How to block USB access in MAC????

Posted on Updated on

For OS X the guide describes disabling USB and Firewire storage:

1. Log on with an administrator account.
2. Browse to ‘/System/Library/Extensions’ folder on the system disk.
3. Trash both IOUSBMassStorageClass.kext and IOFireWireSerialBusProtocolTransport.kext which are found in this directory.
4. Empty the trash.
5. Reboot the machine.

Disabling USB storage on a Windows platform is only a little more complicated:


What If You Forget Mysql Root !!!!!

Posted on

If you have set a root password, but forgot what it was, you can set a new password with the following procedure:

1. Take down the mysqld server by sending a kill (not kill-9) to the mysqld. The pid is stored in a `.pid’ file, which is normally in the MySQL database directory: shell> kill `cat /mysql-data-directory/hostname.pid` You must be either the root user or the same user mysqld runs as to do this.

2. Restart mysqld with the –skip-grant-tables option.

3. Set a new password with the mysqladmin password command: shell> mysqladmin -u root password ‘mynewpassword’

4. Now you can either stop mysqld and restart it normally, or just load the privilege tables with: shell> mysqladmin -h hostname flush-privileges

5. After this, you should be able to connect using the new password. Alternatively, you can set the new password using the mysql client:

(1. Take down and restart mysqld with the –skip-grant-tables option as described above.

2. Connect to the mysqld server with: shell> mysql -u root mysql

3. Issue the following commands in the mysql client: mysql> UPDATE user SET Password=PASSWORD(‘mynewpassword’) WHERE User=’root’; mysql> FLUSH PRIVILEGES;

4. After this, you should be able to connect using the new password.

5. You can now stop mysqld and restart it normally.)


How to block USB access in windows????

Posted on Updated on

Disabling USB storage on a Windows platform is only a little more complicated:

1. From Explorers folder options ensure that hidden files and folders are displayed, file extensions are not hidden and simple file sharing is disabled.
2. Open up the properties for %systemroot%\Inf\Usbstor.inf (%systemroot% would normally be ‘C:\Windows’).
3. Select the security tab and make sure that all options for all users are set to deny. This must include administrators and SYSTEM.
4. Repeat the above for %systemroot%\Inf\Usbstor.pnf
5. If USB storage devices have been used on this machine previously then open up the registry editor otherwise ignore steps 6 and 7.
6. Browse to the registry location ‘HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor’.
7. Open up the registry key ‘Start’ and change the data value to ‘4′. Close the registry editor.

That’s it! If simple file sharing was enabled previously then don’t forget to re-enable it.