Solved: How to allow remote root login in Solaris

In this post we will show you how you allow root login to a solaris sevrer from a remote machine.
  • Login to the Solaris Server via console as root user.
  • Modify the /etc/ssh/sshd_config . Look for the PermitRootLogin entry in the file and change it from no to yes .
PermitRootLogin yes
  • Finally refresh the ssh service so that it re-read the configuration changes you made to sshd_config. For Solaris 10 you can refresh ssh service using svcadm.
     svcadm refresh svc:/network/ssh:default
  • For Solaris 7,8 & 9 you can restart ssh service as below.
     /etc/init.d/sshd restart

Solved: How to reset root password in Redhat Linux or CentOS

In this post we will discuss how to reset the root password of a Redhat linux server if you forgot it.
  • Reboot the server
  • While you are at boot menu press “Up or Down” arrow key to prevent system from booting.
  • Select the boot device and press “e” to edit it.
  • Scroll down the program with arrow key, till you see a line starting with “linux16”. That line will have words “rhgb quiet” .(refer Image 1)


Image 1

  • Now change  “rhgb quiet” to init=/bin/bash  as in image 2.


Image 2

  • After making the change press “ctrl x” to boot the system.
  • Screen will now take you to command prompt without asking for password.
On the command prompt remount root as read-write.
mount -o remount,rw /
Now execute “passwd” command to change the password of root user.  (refer image)



Tip:
  1. Pick strong password else it will throw error of bad password and may not change the password.
  2. If you are getting error “passwd command not found” ensure that your machine is booted with the disk and not the ISO. Many people working on VMs make this mistake so you are not alone 🙂
  • If you are using SElinux you will have to run this extra relabel step before reboot or else you won’t be able to login with the new password.
touch  /.autorelabel
  • Finally reboot the server
exec /sbin/init
Now you should be able to login with new password.
Hope this post is helpful to you. Do let me know if you have any query.

Solved: How to mount ISO in a linux VM

In this post we will discuss how to mount ISO in Linux VM running inside Virtualbox or VMware.
Virtualbox
You can mount ISO in Linux VM running on Virtualbox by following these steps
  • Select the running machine window.
  • Click on Devices > Optical Devices
  • Choose disk image, browse and select ISO .
  • Now go to the redhat linux server and execute the mount command
 mount /dev/cdrom /mnt
VMware
  • If the linux VM is in VMware. You can select the iso image in vmware console similar to what we did for virtual box.
  • Right click on the machine > “Removable Devices” > “CD/DVD” > Settings. Browse and select the ISO. Check mark on “Connected”.
  • Finally execute the following command in Linux VM.
    mount /dev/sr0 /mnt
  • If you do “df -h” new ISO should be mounted and visible to you as /mnt .
Tip: If you are getting error /mnt busy ensure that /mnt is not already mounted. If /mnt is already mounted either unmount /mnt first and try again or create a new directory and mount the ISO on the new directory.

Solved: Reactivate hardware raid volume after system board replacement- Solaris

Replacing the systemboard/motherboard of a server which has hardware RAID enabled is a major activity. In this post we will discuss about the steps that you should follow.
Caution:- You should be extremely careful while doing this activity and take complete backup of all your data.
1) Collect the explorer and take full backup of all data specially OS.
2) Bring down the server.
3) Replace the motherboard and put back the old disks in server.
4) Change the setting from SP to factory default as many refurbished system board may have old LDOM config in them. It can be done as below:-
LDOM Resetting through the Service Processor.
-> set /HOST/bootmode config="factory-default"

-> stop /SYS

Are you sure you want to stop /SYS (y/n)? y
Wait for machine to power off.
We can then power on the system.
-> start /SYS

Are you sure you want to start /SYS (y/n)? y

Starting /SYS

-> start /SP/console
5) Now upgrade the firmware so that it's same as the firmware of old board. It can be done using sysfwdownload utility. Follow the readme of firmware patch for detailed instructions.
6) If you cannot see the disks in OS which are in hardware RAID it can be because the volume is inactive. It can be activated from ok prompt as follows:-
Go to the OBP prompt.
At the command line, set the auto-boot? and fcode-debug? variables to false and reset the system.
 ok setenv auto-boot? false
 auto-boot? = false
 ok setenv fcode-debug? true
 fcode-debug? = true
 ok reset-all
Find the path to the controller.
 ok show-disks
 a) /pci@0/pci@0/pci@2/LSILogic,sas@0/disk
 b) /pci@0/pci@0/pci@1/pci@0/usb@1,2/storage@1/disk
 q) NO SELECTION
 Enter Selection, q to quit: q
 ok
Note - You are looking for the path to the controller. It generally contains the phrase “LSILogic,sas@0” or the phrase “scsi@0“.
Select the controller.
 ok select /pci@0/pci@0/pci@2/LSILogic,sas@0
Show the volumes, look for any inactive volumes.
 ok show-volumes
Activate the inactive volumes. Repeat the command to activate all inactive volumes. For example, to activate volume number 1 type:
ok 1 activate-volume
Note - There might be more than two inactive RAID volumes, but you cannot activate more than two.
Deselect the controller.
ok unselect-dev
Set the auto-boot? and fcode-debug? variables to true and reset the system.
ok setenv auto-boot? true
 auto-boot? = true
 ok setenv fcode-debug? true
 fcode-debug? = true
 ok reset-all
7) Once the volume is enabled you should be able to see the LSI disk in probe-scsi-all and also in format once the server is booted.
Note:- This post is created just for your reference. Please try it first in your test server. We are not responsible for any loss caused by following this tutorial.

Solved: How to come out of VMware console

If you want to come out of vmware console window simply press Alt + Ctrl or Ctrl + Alt any of the two sequence will work.
If you want the movement between your host machine and VMware console to be seamless, install VMware tools in the guest VM.  This will ensure that you don’t have to press Ctrl+ Alt  every time.
Check this site to download VMware tools.