How To Disable CD/DVD ROM And USB Port On Linux Systems

 
There are many methods to do this and I will be covering some of these methods here
These methods has been successfully tested on RHEL and CentOS but I am also sure it will work on many other Linux distributions.
 
Disabling CD/DVD ROM
 
1. Method:
 
A more practical and reversible way is to rename the kernel module
Log into the linux system and enter the following inputs on the system console
 
[root@lnxesx ~]# cd /lib/modules/$(uname -r)/kernel/drivers/cdrom
[root@lnxesx cdrom]# ls
cdrom.ko-ok
[root@lnxesx cdrom]# mv cdrom.ko cdrom.ko-ok
 
Disabling USB Port

1. Method:

Similarly to the method used above for CD/DVD ROM, USB ports can be disabled using same method as well.
 
[root@lnxesx ~]# cd /lib/modules/$(uname -r)/kernel/drivers/usb/storage
[root@lnxesx storage]# ls
ums-alauda.ko   ums-datafab.ko  ums-isd200.ko    ums-karma.ko     ums-sddr09.ko  ums-usbat.ko
ums-cypress.ko  ums-freecom.ko  ums-jumpshot.ko  ums-onetouch.ko  ums-sddr55.ko  usb-storage.ko-ok
[root@lnxesx storage]# mv usb-storage.ko usb-storage.ko-ok
 
2. Method:
 
Grub option
 
You can get rid of all USB devices by disabling kernel support for USB via GRUB. Open grub.conf or menu.lst (Under Debian / Ubuntu Linux) and append “nousb” to the kernel line as follows:
 
kernel /vmlinuz-2.6.18-128.1.1.el5 ro root=LABEL=/ console=tty0 console=ttyS1,19200n8 nousb
 

Posted in Linux and tagged , , , , by with comments disabled.

Enable or Disable CDROM and USB Port On Windows Systems

A common security concern at organizations is allowing users to plug in a usb flash drive, because they could so easily copy corporate data.
 
To Enable or Disable USB port:
 
1. Method:
 
1. Click Start, and then click Run.
2. In the Open box, type regedit, and then click OK.
3. Locate, and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor
4. In the right pane, double-click Start.
5. In the Value data box, type 3 to Enable and 4 to disable, click Hexadecimal (if it is not already selected), and then click OK.
6. Quit Registry Editor.
 
2. Method:
 
Since Windows XP SP2, you can disable writing to USB devices altogether using a simple registry hack. Here it is:
 
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies]
“WriteProtect”=dword:00000001
 
You can also just download one of the following registry tweaks to enable or disable writing to USB drives.
 
Enable USB Write
 
Disable USB Write
 
Once you use the registry hack, you will have to reboot for the changes to take effect. One should also note that if you are using this trick, you should make sure that the users are not administrators on the computer, because they could easily change this setting back.
 
This works on Windows Vista as well. Here’s the window you’ll get when you try and write to a USB drive: 
 
 
To Enable or Disable CD/DVD  ROMport:
 
1. Click Start, and then click Run.
2. In the Open box, type regedit, and then click OK.
3. Locate, and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\cdrom
4. In the right pane, double-click Start.
5. In the Value data box, type 1 to Enable and 4 to disable, click Hexadecimal (if it is not already selected), and then click OK.
6. Quit Registry Editor.
 

Posted in Windows and tagged , , , , by with comments disabled.

How To Make Bootable USB-Drive For Windows Password & Registry Editor

If you forget your Windows password and wonder if you’ll ever have the chance to log into your system again, well… this might be helpful 😉

We’re going to use “Offline NT Password & Registry Editor” to reset the password of user(s) we want. This tool is one of the best and fastest password recovery tool for windows (almost all versions). It is a windows console tool and easy to use.

Offline NT Password & Registry Editor

Requirements:

a) USB-Drive (must NOT be formated but advisable)

b) USB-Drive formating tool (optional) found here

c) Offline NT Password & Registry Editor (USB version). Click here to download

 

STEPS:

Skip step 1 if you do NOT want to format the USB-Drive

1.) insert the USB-Drive into your computer and use the downloaded tool (b) above to format it. It is advisable to use FAT32 filesystem

2.) Unzip the download “Offline NT Password & Registry Tool” into a folder called “usb110511”

3.) copy all contents from the folder usb110511 into the root of the USB-Drive

4.) Install bootloader on the USB drive, from command prompt in windows (start the command line with “run as administrator” if possible)

5.) type X: + EnterKey (where X is the letter of your USB-drive) to change directory to the usb drive

6.) type X:\>syslinux.exe -ma X:

windows command prompt

That’s it!

Safely unplug the USB-Drive from the second computer and use it to boot your system with the lost password.

It might be neccessary to adjust your BIOS settings to allow booting from the USB-Drive

Follow the instructions carefully to reset your password. Most of the default settings is safe to accept by tapping on the EnterKey. Be carefull to select the correct Windows system partition otherwise it won’t work. In some systems (standard systems from dell, compaq etc), the first partition (/dev/sda) is usually reservered.

Enjoy and best of luck!


Posted in Vista, Windows, Windows 7, Windows Vista, Windows XP and tagged , , , by with 12 comments.

How to Clone USB Device on a Linux/Unix System

 

A friend once wrote me requesting this tutorial on how to clone an USB storage drive on a second USB device. The aim is to produce identical copy of the original. To achieve this, we need a Linux or UNIX system. We are going to be using Fedora Linux for the purpose of this tutorial.

 

Follow these simple steps:

 

1.) Login into the system as a regular user

2.) Switch to root by typing: 

     $su –

3.) Enter the root password

4.) Plug in the source USB and type at the prompt:

     fdisk -l to see what device name the source USB has

     (this may appear as /dev/sdb)

5.) Plug in the destination USB and type at the prompt:

     fdisk -l to see what device name the destination USB has

     (this may appear as /dev/sdc)

6.) Once you have both names determined, simply type the following:

     dd if=/dev/sdb of=/dev/sdc conv=notrunc

     (as we do not want to truncate the output file, we simple use the option notrunc)

   
    The result of this command is an identical copy of the original USB device.

 

    To make an image of the entire drive including MBR (boot files), type in terminal:

    dd if=/dev/sdb of=/path/to/destination/image.dd conv=notrunc.

 

    To restore the image to a new drive seen as /dev/sdc:

    dd if=/path/to/image.dd of=/dev/sdc conv=notrunc

 


Posted in Linux and tagged , , by with comments disabled.

Autorun Apps from your USB Drive

Just like there is autoplay feature on CDs and DVDs, it is also possible to autorun programs and applications from your removable USB flash drives on Windows XP SP2.

The follwoing is a quick guide on how to autorun portables applications from your USB drive.

  1. Open Notepad
  2. Type in:

      [AutoRun]
      open=PortableApps\PortableAppsMenu\PortableAppsMenu.exe
      action=Start PortableApps.com
      icon=PortableApps\PortableAppsMenu\PortableAppsMenu.exe
      label=PortableApps
      Shell\Option=PortableApps
      Shell\Option\Command=PortableApps\PortableAppsMenu\PortableAppsMenu.exe

  3. Save the files as autorun.inf
  4. Put the files in the root of your USB flash drive
  5. The next time you insert your flash USB drive into any PC running Windows XP SP2, the specified program will autorun from the USB drive.

Below are the explanations to the above options used in our autorun.inf file.

  open=PortableApps\PortableAppsMenu\PortableAppsMenu.exe

The open option specifies the program that should autorun. You must use relative paths here. Do NOT specify the drive letter since it may vary from PC to PC.

  action=Start PortableApps.com

This describes the action that will be performed. This parameter is used by Windows Explorer in the autoplay dialog.

  icon=PortableApps\PortableAppsMenu\PortableAppsMenu.exe

Specifies the icon to be used for the USB drive. The icon can be fetched from an .EXE file or it can be in the normal .ICO format. More on changing icons here

  label=PortableApps

This label parameter is used to specify the name of the drive. Basically, this can be anything you want to call your flash drive.

  Shell\Option=PortableApps

Optionally specify the text displayed in the shortcut menu for the Option above.

  Shell\Option\Command=PortableApps\PortableAppsMenu\PortableAppsMenu.exe

Adds a custom command to the drive’s shortcut menu. This is also the text that will appear in the shortcut menu unless specifically altered to some other text.

In many systems, the autorun is disabled by default for security reasons. Unless it is very neccessary, you are adviced to keep the default settings. Why this might be true for many users, there are those like me who would rather have the autorun enabled to ease working with PortableApps.

If your Autorun is disabled, go here to learn how to enable it.


Posted in Vista, Windows, Windows 7, Windows Vista, Windows XP and tagged , , , , , by with comments disabled.