scsi_id not returning any output in a VM on VMware ESX

  1. scsi_id not returning result:

    scsi_id -g -u -d /dev/sdb
    No Result

  2. Start the vSphere Client, and log in to a vCenter Server.
  3.  Select Virtual Machines for which you want to retrieve disk unique id. I need this attribute for udev rules to prepare disks for ASM, for example.
  4.  Right-click the virtual machine for which you are enabling the disk UUID attribute, and select Power > Power Off.
    The virtual machine powers off.
  5. Right-click the virtual machine, and click Edit Settings.
  6. Click the Options tab, and select the General entry in the settings column.
  7. Click Configuration Parameters.
    The Configuration Paramters window appears.
  8. Click Add Row.
  9. In the Name column, enter disk.EnableUUID
  10. In the Value column, enter TRUE.
  11. Click OK and click Save.
  12. Power on the virtual machine.
  13. Now, it returns id:

    scsi_id -g -u -d /dev/sdb

Crontab -e You (oracle) are not allowed to use this program (crontab)

$ crontab -e
You (oracle) are not allowed to use this program (crontab)
See crontab(1) for more information

# The following files control crontab usage


# Go to the root user and add oracle user to the following file:

echo oracle > /etc/cron.allow

# Or delete oracle from /etc/cron.deny file. 🙂

How to restore file permissions of the installed package to its default on Linux?

Hello all,

(Please, note that in command string instead of “” there are two dashes “- -“ like “–setperms” it is “– -setperms”)

By mistake, I run the following command on / directory:

chmod -R 777 *

I stopped this command, but unfortunately some file permissions were changed.

Because of that, I was not able to connect to the server with WinSCP and ssh was not working.

I looked in to the /var/log/messages and found the following entry:

Sep  6 15:02:37 stbynode sshd[24226]: fatal: /var/empty/sshd must be owned by root and not group or world-writable.

I run the following command on another server:

ls -la /var/empty/sshd
total 16
drwx–x–x 3 root root 4096 Sep 3 21:07 .
drwxr-xr-x 3 root root 4096 Sep 3 21:07 ..
drwxr-xr-x 2 root root 4096 Sep 3 21:36 etc

On my server it was:

ls -la /var/empty/sshd
total 16
drwxrwxrwx 3 root root 4096 Sep 3 14:00 .
drwxrwxrwx 3 root root 4096 Sep 3 14:00 ..
drwxrwxrwx 2 root root 4096 Sep 3 14:00 etc

You can change these permissions by hand (that will be boring if not only one file permissions have been changed)but there exist one very useful command:

rpm  –setperms {packagename}

This will reset package permissions, because of rpm database contains permission information.

So I run the following :

for p in $(rpm -qa); do rpm –setperms $p; done

Note this script will reset permissions of the  installed package, not user created file…

After completed this command , I was able to connect to the server with WinScp and  /var/empty/sshd permissions were set to drwxr-xr-x

To avoid such kind of situation my advice would be to save permission information everyday. By running the following command using crontab:

find / -exec stat –format “chmod %a ${MPOINT}%n” {} \; > /tmp/

Good Luck , I hope the post was helpful…