12/03/2016

RHEL5, gdm autologin as root

The gnome desktop manager will disregard a gdm/custom.conf configuration to automatically login as the root user and present a standard greeter prompt instead. Normally configuring gdm to autologin as any user other than the root user would not prompt for a password and simply login and present a default graphical desktop. Here is how to configure gdm to autologin as the root user.


create a new regular user account

# useradd testuser

run gdmsetup from a desktop cmdline window,
or use the the gui tool [System]/[Administration]/[Login Screen]



select the [Security] tab
check the [v/] Enable Automatic Login
enter: the  new regular user account

under [Security]
check: Allow local system administrator login
check: Allow remote system administrator login
press [x][Close] to save the changes

edit the /etc/passwd file and make the following changes:

change the uid for the testuser to [0]
change the gid for the testuser to [0]
change the home directory path  [/root]



save the file

reboot

the system will automatically boot into a gnome windows desktop with root privileges

The reason this works is the uid and gid are the same as the root user. Whatever coding intervention prevents the autologon procedure from continuing appears to only inspect the username and not the uid or the gid.

So setting the enabled Automatic Login "user" to something other than "root" is [allowed] and continues without prompting for a normal logon password. Once the session is started, every other program identifies the user as the root user and proceeds as if the root user had logged in.

This could be considered a security [bug], but its really a security "best practice" to not turn-key systems into default insecure tools. There will always be special situations that warrant moderation of a best practice for practical reasons.


RHEL5, at boot /dev/cdrom open fail

The problem is at boot time you may get a failed reference to /dev/cdrom

It is caused by the LVM mounting tools trying to probe a cdrom device.

You need to edit the LVM conf to "filter" out cdrom devices and not try to probe them.

How to reproduce the problem:

# lvdisplay  

 /dev/cdrom: open failed: No medium found

How to fix the problem:

# vi /etc/lvm/lvm.conf

You can only have [one] filter active at a time, the default probes everything.

Comment that filter line out, then add this filter line in:

filter = [ "r|/dev/cdrom|" ]

https://access.redhat.com/solutions/342123

RHEL5, Fixing 10 sec boot delay


Basically, nash is the initrd shell script processor. It loads drivers for the kernel when the initrd is loaded into memory. But in RHEL5 is has a "static" Wait for.. that only applies to some old SCSI hardware no one uses anymore, and its too late to make a change upstream and take it out. Here's how to fix that.

Simply, edit the default [ /sbin/mkinitrd ] shell script

# vi /sbin/mkinitrd

seach for

//\proc/\scsi/\scsi

it should take you to this line

emit "stabilize --has --internal 1000 /proc/scsi/scsi

add a hash to the beginning of the line (to commented the line out)

# emit "stabilize --has --internal 1000 /proc/scsi/scsi

save the file and build a new initrd for your current kernel

example:

 # mkinitrd /boot/initrd-2.6.18-410.el5.img 2.6.18-410.el5

if you get an error make sure you referred to the kernel your actually using
(check the /boot directory and the /boot/grub/menu.lst default boot option stanza)

make sure you have kernel src and kernel headers and a gcc installed
(in this version of redhat kernel headers are in the kernel-devel package)

yum install kernel kernel-devel gcc


this "makes" a new initrd placing it in the path and filename of the first option

and puts this new initrd together using drivers and modules for the kernel named in the second option

Caution: make sure you have a backup kernel and initrd to choose from in the grub menu if something goes wrong

and reboot

the long 10 second delay will be gone

This was helpful in understanding the problem and explains the solution, but lacks a little bit of detail:

Fixing “Waiting for driver initialization” delay issue while booting on RHEL 5.4