This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Friday, December 1, 2017

SSH Key Gen & SSH Keys on windows system to Linux Server

Friday, December 01, 2017 0

SSH Key Gen & SSH Keys on windows system to Linux Server 

NAME
     ssh-keygen - authentication key generation, management and conversion


ssh-keygen generates, manages and converts authentication keys for ssh.  ssh-keygen can create RSA keys for use by SSH protocol version 1 and DSA, ECDSA or RSA keys for use by SSH protocol version 2. The type of key to be generated is specified with the -t option.  If invoked without any arguments, ssh-keygen will generate an RSA key for use in SSH protocol 2 connections.

SSH Key Generation:

[nsk@nsk-linux ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/nsk/.ssh/id_rsa):      - Just give enter
Enter passphrase (empty for no passphrase):                           - Dont give passphrase
Enter same passphrase again:               
Your identification has been saved in /home/nsk/.ssh/id_rsa.
Your public key has been saved in /home/nsk/.ssh/id_rsa.pub.
The key fingerprint is:
ae:67:71:78:9e:b5:31:1e:bb:7b:c7:0a:3b:18:0b:c8 nsk@nsk-linux
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|                 |
|                 |
|     . .S.       |
|      E.+ + =    |
|        .* B.* . |
|       .o = =o. o|
|      .o    +=.o |
+-----------------+

[nsk@nsk-linux ~]$ cd .ssh/
[nsk@nsk-linux .ssh]$ ls -al
total 48
drwx------  2  nsk  nsk  4096 Dec  1  10:08 .
drwx------ 37 nsk  nsk  4096 Nov 26 09:51 ..
-rw-------  1   nsk  nsk  1675 Dec  1  10:08 id_rsa
-rw-r--r--  1   nsk  nsk   395 Dec  1   10:08 id_rsa.pub
-rw-------  1   nsk  nsk  8594 Nov  7   08:23 known_hosts


We need to convert id_rsa key (windows to linux) for successful password less authentication from windows system

1. Save the id_rsa key in Windows system
2. Use Putty Key Generator tool & click the conversions
3. Click Import Key & Browse the id_rsa key
                                      click_conversion_select_key
Once_loaded_click_save_private_key_popup_yes
4. Click Save Private Key. Once pop up comes, click save the key without a passphrase on local system.
save_key_in_local_system

5. Copy  id_rsa.pub key to /home/nsk/.ssh/authorized_keys  (change the user home directory)
[nsk@nsk-linux .ssh]$ cat id_rsa.pub >> /home/nsk/.ssh/authorized_keys
[nsk@nsk-linux .ssh]$ cat authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAv4ZERTCXFpGZLrNKBOQfiTE5SEQYvtiolNt8KnMVY9bxwEUMyPUX9EwmJxW51BY8I9Xq6VGoU2nskS0GrTgqjAOeptTRia0ws7inkc9oHVHryqJdgvhYvpVj2lLsnRTO9Lv4P6Pkycvg5xioAKRTdL8EffPxWtu8x1iL6aYsHThxsrpmXzK0LrkHLnGsJT5nRtNOWlUJW9npNPRBSqRmPjFCRpWb2kgn7MUKJnr5rXA2kgrULCvx97EFDxA/HYAxFgld7yGdnPjdZWyrkXK/FsFmsU4xoGoSNVKG1Vq1R18rc/cNjtVPME9TBxD8OBB8FQYiyHLYWLF+x9EbGsY+lQ== nsk@nsk-linux


6.  Here .ssh should be 0700 permission and authorized_keys should be 0600 permisssion.


7.  Open putty tool - Enter the Server IP in session ==> expand the SSH ==> select AUTH and browse the key ==> Select the key


session_ip_ssh_AUTH_select_key
8. Give username & enter. Here Putty session wont ask password.
ssh_with_key_authentication


Hope it helps.

Could not load XPCOM Solved

Friday, December 01, 2017 0
Mozilla Firefox error : Couldn't load XPCOM  while loading.




Cause - C drive space got filled. So there is no space for exploring the firefox

Solution : Remove the unwanted files & clear the Temp folder.

Monday, November 27, 2017

Integrated Lights Out Manager ILOM Command line Linvirtshell

Monday, November 27, 2017 0

Integrated Lights Out Manager ILOM Command line

Login with ILOM root password
[root@testserver ~]# ssh test-ilom.example.com
Oracle(R) Integrated Lights Out Manager
Version 3.2.8.25 r114493
Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
Warning: HTTPS certificate is set to factory default.
Hostname: test-ilom

Below targets are available to check in console. Once you run ls command, will get the property information of hardware. In that property we can get ILOM IP address, MAC ID, Server Model, Serial No & Operating system detail as well.

-> ls

 /System
    Targets:
        Open_Problems (0)
        Processors
        Memory
        Power
        Cooling
        Storage
        Networking
        PCI_Devices
        Firmware
        BIOS
        Log
    Properties:
        health = OK
        health_details = -
        open_problems_count = 0
        type = Rack Mount
        system_fw_version = 3.2.8.25
        locator_indicator = Off
        power_state = On
        actual_power_consumption = 305 watts
        action = (none)

a. To check power supply status
-> cd /System/power
/System/Power

-> show

 /System/Power
    Targets:
        Power_Supplies

    Properties:
        health = OK
        health_details = -
        actual_power_consumption = 383 watts
        max_permitted_power = 788 watts
        installed_power_supplies = 2
        max_power_supplies = 2

->
Login as root & run ipmitool command.
[root@test-ilom~]# ipmitool sunoem cli
Connected. Use ^D to exit.
-> show -l all /System/Power/Power_Supplies location health -t
Target             | Property              | Value
-------------------+-----------------------+-----------------------------------
/System/Power/     | health                | OK
Power_Supplies/   |                       |
Power_Supply_0   |                       |
/System/Power/     | location              | PS0 (Power Supply 0)
Power_Supplies/   |                       |
Power_Supply_0   |                       |
/System/Power/     | health                | OK
Power_Supplies/   |                       |
Power_Supply_1   |                       |
/System/Power/     | location              | PS1 (Power Supply 1)
Power_Supplies/   |                       |
Power_Supply_1   |                       

b. To check Processors status
-> cd Processors
/System/Processors

-> show

 /System/Processors
    Targets:
        CPUs

    Properties:
        health = OK
        health_details = -
        architecture = x86 64-bit
        summary_description = Two Intel Xeon Processor E5 Series
        installed_cpus = 2
        max_cpus = 2

c. To check BIOS version
-> cd BIOS
/System/BIOS

-> show

 /System/BIOS
    Targets:
        Config

    Properties:
        system_bios_version = 17120100
        boot_mode = Legacy
        reset_to_defaults = none

Sunday, November 26, 2017

Ignore first 4 lines of cat command output and display first word of remaining lines Unix

Sunday, November 26, 2017 0

Below awk command is very useful to run small scripts in Unix.

Ignore first 4 lines of cat command output and display first word of remaining lines  Unix

Purpose Ignore first 4 lines of cat command output and display first word of remaining lines.

[root@nsk-linux tmp]# cat test.txt
Public cloud is future
Automation never ends
Infra as a Service
Private Cloud
Baremetal Cloud Service
Amazon Cloud service

[root@nsk-linux tmp]# cat test.txt |  awk '{if(NR>4)print $1}'
Baremetal
Amazon

Here, as per our need we can change the value.

Saturday, November 25, 2017

Virtual machines show warning messages when starting the udev daemon Linux

Saturday, November 25, 2017 0

Virtual machines show warning messages when starting the udev daemon.

After upgrading VMware Tools,  Linux virtual machines show warnings when starting the udev daemon.

dmesg shows the below messages.

Starting udev:
udevd[572]: add_to_rules: unknown key 'SUBSYSTEMS'
udevd[572]: add_to_rules: unknown key 'ATTRS{vendor}'
udevd[572]: add_to_rules: unknown key 'ATTRS{model}'
udevd[572]: add_to_rules: unknown key 'SUBSYSTEMS'
udevd[572]: add_to_rules: unknown key 'ATTRS{vendor}'
udevd[572]: add_to_rules: unknown key 'ATTRS{model}'

Ctrl+C will bypass udev daemon to finish the boot process.

To disable the warning message, comment out unused lines (ubuntu  & other type of unix entries) in the  /etc/udev/rules.d/99-vmware-scsi-udev.rule file

For linux we need to modify the below line from

ACTION=="add", BUS=="scsi", SYSFS{vendor}=="VMware, " , SYSFS{model}=="VMware Virtual S", RUN+="/bin/sh -c 'echo 180 >/sys$DEVPATH/device/timeout'"

To

ACTION=="add", BUS=="scsi", SYSFS{vendor}=="VMware " , SYSFS{model}=="Virtual disk ", RUN+="/bin/sh -c 'echo 180 >/sys$DEVPATH/device/timeout'"

Save the modifiation and reboot the virtual machine.

Friday, November 24, 2017

Phpldapadmin Renew the expired openldap user

Friday, November 24, 2017 0

Phpldapadmin  Renew the expired openldap user 

Login to phpldapadmin admin console by using Admin id & password.
Explore the ldap directory & search the user in left side
Select the user and click
Right side we can see the user property.
Update the password directly in password section.

Before changing the Shadow Last Change, the ShadowMax & ShadowWarning settings will be like below 


Update the date in Shadow change as per your policy.

 
Once changed the ShadowLastChange setting to current date, ShadowMax & ShadowWarning will change.

Note: Once you changed the password & shadow Last Change settings click update objects. Then only above change will take effect.

Update or Recover root password using Host Profiles VMware

Friday, November 24, 2017 0
VMware Update or Recover root password using Host Profiles.
Create the Host Profile


1. Right click any host in your inventory (it doesn’t matter which), choose Host Profile, then Create Profile from Host.


2. Name the Host Profile and give it a description. Click Next.

3. Click Finish to create the Host Profile.

Configure the Host Profile
I. Open Host Profiles.


II. Right-click the Host Profile and choose Edit Profile.

III. Expand Security Configuration, choose Administrator password
    Choose Configure a fixed administrator password, type in the password twice, then click OK.


IV. Right-click the Host Profile and choose Enable/Disable Profile Configuration.

V. Uncheck everything in the Host Profile configuration except the Security Configuration, click OK.

a. Apply the Host Profile to the ESXi Host (or vSphere Cluster)

b. Right click any host in your inventory, choose Host Profile, then Manage Profile.

c. Choose the Password_Reset Host Profile, click OK.

d. Right click any host in your inventory, choose Host Profile, then Apply Profile.

e. Recheck the changes to be applied, click Finish

Log In
     Log in with the new password. If the setting has been changed successfully, you should be able to log in with the new password immediately.


Thursday, November 23, 2017

for loop command for grep the particular file system from list of servers.

Thursday, November 23, 2017 0

Double For loop command for grep the particular file system (mount point) from list of servers.

Here,
 servers       -  contains server list
 fmount        -  mount point

Run the below command. It will login to the list of server and search the mount point and print the output.

#for j in `cat servers`; do for i in `cat fmount`; do echo $j; ssh $j df -hP | grep -i $i; done; done

Modify the variable as per your needs.