‏הצגת רשומות עם תוויות root. הצג את כל הרשומות
‏הצגת רשומות עם תוויות root. הצג את כל הרשומות

יום חמישי, 24 באפריל 2014

UNABLE TO LOGON VMWARE VCENTER APPLIANCE WITH ROOT

Symptoms

  • You are unable to log into the root account for the vCenter Server Appliance (vCSA).
  • The root account for the vCSA is locked.

Purpose

This article provides instructions on preventing the forced lockout of the root account and on unlocking a locked root account.

Cause

The 5.5 release of the vCenter Server Appliance (vCSA) enforces local account password expiration after 90 days by default. This policy locks out the root account when the password expiration date is reached.

Resolution

This behavior affects vCenter Server Appliance 5.5.

Prevent forced lockout when the root account is still active

If the root account is still accessible through the vCSA console or via the secure shell (SSH), you can prevent this issue from occurring by modifying the /etc/cron.daily/pass-expiration script.

To prevent the forced lockout when the root account is still active:

  1. Log in to the vCSA as the root user.
  2. Open the /etc/cron.daily/pass-expiration script in a text editor.
  3. Replace the commands at the bottom of the script to replace the forced lockout with a forced password change:

    1. Delete these commands:

      # disable the password if it's time and not already done.
      # don't rely on the pam account facility. prepend an x in the shadow file.
      if [ $TODAY -ge $DEADLINE ] && ! grep -q 'root:x' $SHADOW; then
         sed -e 's/^root:\(.*\)/root:x\1/' $SHADOW -i
      fi

    2. Enter these commands:

      # force a password change for root if we've reached the password expiration date.
      # pam.unix2 doesn't do this the way we would like, so we do this instead.
      if [ $TODAY -ge $DEADLINE ]; then
         chage –d 0 root
      fi
  4. Save and close the file.

Unlocking a locked out root account

If the root account is not accessible via the console, the secure shell, and the Virtual Appliance Management Interface (VAMI), the root account has been inactivated due to password expiration. To reactivate the root account, the vCSA must be rebooted and the kernel option modified in the GRUB bootloader to obtain a root shell.

To reactivate the root account:

  1. Reboot the vCSA using the vSphere Client.
  2. When the GRUB bootloader appears, press the spacebar to disable autoboot.



    Note: If the time between when you power on the virtual machine and when it exits the BIOS or EFI and launches the guest operating system is too short, you can adjust the delay. For more information, see Delay the Boot Sequence in the vSphere Client in the vSphere Single Host Management guide.
  3. Type p to access the appliance boot options.
  4. Enter the GRUB password.

    Note:
    • If the vCSA was deployed without editing the root password in the Virtual Appliance Management Interface (VAMI), the default GRUB password is vmware.
    • If the vCSA root password was reset using the VAMI, then the GRUB password is the password last set in the VAMI for the root account.
  5. Use the arrow keys to highlight VMware vCenter Server Appliance and type e to edit the boot commands.


  6. Scroll to the second line displaying the kernel boot parameters.


  7. Type e to edit the boot command.
  8. Append init=/bin/bash to the kernel boot options.


  9. Press Enter. The GRUB menu reappears.
  10. Type b to start the boot process. The system boots to a shell.
  11. Reset the root password by running the passwd root command.
  12. Restart the appliance by running the reboot command.
  13. Important: Follow the instructions in the Prevent forced lockout when the root account is still active section of this article to prevent future root account lock out and retain password expiration functionality.

Additional Information

The vCSA allows you to establish your own password expiration and warning email policies by using the Admin tab of the Virtual Appliance Management Interface (VAMI).



By default, the password expiration on the local root account in the vCSA is set to 90 days after the password has been changed. This typically occurs at first boot. If the password is not changed on installation, there is a 90-day period before expiration.

Email addresses configured in the Admin tab in the VAMI (https://IP_address:5480 or https://VAMI_host_name:5480) receive email notifications each day for seven days prior to password expiration. The email settings, such as relay SMTP server, are configured through the vSphere Client in the vCenter Server mail settings.  



יום חמישי, 23 בינואר 2014

Reset vCenter Appliance root password

To reset the root user password in the vCenter Boot the virtual appliance and navigate to the console for the virtual machine in the vSphere Client. Click in the console and press any key to display the GRUB menu. 

Note: The GRUB prompt remains on screen for few seconds before it starts the boot sequence. 

On the GRUB menu, select SUSE Linux Enterprise Server for VMware.

Type e to edit the line. A list of items in the GRUB configuration file appears.

Select the line that starts with kernel and type e to edit the line.

At the end of the line, press the spacebar and type init=/bin/sh.

Press Enter to exit edit mode.

On the GRUB screen, type b to boot into single-user mode. 

The virtual appliance boots in single-user mode.

To change the root user password, type passwd root and follow the on-screen prompts.

To restart the virtual appliance, type reboot and press Enter.

When the virtual appliance restarts, you can log in using the new password.

יום שלישי, 3 בדצמבר 2013

יום שני, 2 בדצמבר 2013

How to Login as Root in Ubuntu

1. sudo passwd root
 
2. sudo sh -c 'echo "greeter-show-manual-login=true" >> /etc/lightdm/lightdm.conf.d/50-unity-greeter.conf' 

3. reboot the system

יום שני, 13 במאי 2013

Extend an LVM root filesystem

#fdisk -l
#fdisk /dev/sdb
e8 
w

#lvdisplay
#pvcreate /dev/sdb2

#vgextend VolGroup00 /dev/sdb2
(this associates the physical volume with our volume group VolGroup00)
At this point our new partition is available in our volume group as free space.  We use the following command to confirm that and also to record the amount of free space:
#vgdisplay
From the output of this command we should see an entry called “Free PE” – this is the free physical extents (in other words our free space).  We can use this value to extend our existing logical volume LogVol00 for example (this shows 1234 free extents):
#lvextend -l +1234 /dev/VolGroup00/LogVol00
After this command completes the logical volume LogVol00 will be extended by the amount of free space our new partition has.  You can display this using the command:
#lvdisplay
You should notice the “LV size” has increased.  At this point our / filesystem still doesn’t know about the new space, so the last piece of the jigsaw is to let it know about the new space:
#resize2fs /dev/VolGroup00/LogVol00
Once this command completes our / filesystem should see our new free space.  You can confirm this using the command:
#df -h /

useful link:
http://geekswing.com/geek/unix/extending-a-linux-disk-with-lvm-extending-root-partition/


Intermission to add new disk and power on if necessary
# fdisk -l
To see the new disk size on /dev/sda which we just extended, or to see new disks we just presented (/dev/sdb, /dev/sdc, etc.)
# fdisk /dev/sda
To create new partitions for the OS to use. These new partitions will be added to the VG so we can extend the LV that the “/” partition is on. My newly created partition in the example is /dev/sda3. For new disks you would use /dev/sdb, or /dev/sdc. If you are using an extended /dev/sda like in my case, you will need to reboot for the changes to be seen
# fdisk -l
To see the new partitions
# pvdisplay
View current physical volumes a.k.a. pv
# pvcreate /dev/sda3
Allow Linux OS to use the new partition in LVM
# pvdisplay
See the new pv /dev/sda3
# vgdisplay
View the current volume groups
# vgextend vg_cents6364bit /dev/sda3
Add the new PV /dev/sda3 to the existing VG vg_cents6364bit
# vgdisplay
Now you can see the new size of the VG vg_cents6364bit. Note the new amount of free PE’s (physical extents)
# lvdisplay
View the current LV. In my example, /dev/vg_cents6364bit/lv_root which is the root partition
# lvextend -l +2559 /dev/vg_cents6364bit/lv_root
Now make the LV larger. Growing the LV /dev/vg_cents6364bit/lv_root by 2559 PEs
# lvdisplay
Now you can see the larger size of the LV
# resize2fs /dev/vg_cents6364bit/lv_root
Online resize of the actual filesystem now on that LV
# df -h
You can see the new size now using the “df” command

DONE!!