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

Thursday, December 7, 2017

OpenLdap user login issue asking to enter password again and again

Thursday, December 07, 2017 0
Situation:

              Openldap user is having issue while login to the server, it is asking password again and again.


Solution:

             Restart nslcd service. 

[root@testserver~]# /etc/init.d/nslcd restart
Stopping nslcd:                                            [  OK  ]
Starting nslcd:                                              [  OK  ]

NAME
       nslcd - local LDAP name service daemon. nslcd is a daemon that will do LDAP queries for local processes based on a simple configuration file.

Home directory Error oddjob-mkhomedir not working

Thursday, December 07, 2017 0

Home directory Error oddjob-mkhomedir not working

Situation:
While login as user, getting Error  oddjob-mkhomedir not working 

Solution:
1. yum install dbus oddjob oddjob-mkhomedir
2. service restart messagebus
3. service restart oddjob
4. Add the line "session required pam_oddjob_mkhomedir.so" to /etc/pam.d/sshd  file
5. Delete a users home directory (rm -rf /home/nskselvan)
6. Disable and enable the "Use LDAP Authentication" in authconfig-tui (authconfig-tui - an interface for configuring system authentication resources)
7. Log in using ssh as this user.

[root@testserver ~]# yum install dbus oddjob oddjob-mkhomedir
Setting up Install Process
Package 1:dbus-1.2.24-8.0.1.el6_6.x86_64 already installed and latest version
Package oddjob-0.30-5.el6.x86_64 already installed and latest version
Package oddjob-mkhomedir-0.30-5.el6.x86_64 already installed and latest version
Nothing to do

[root@testserver ~]# service  messagebus restart
Stopping system message bus:                               [  OK  ]
Starting system message bus:                                 [  OK  ]
[root@testserver ~]# chkconfig messagebus on
[root@testserver ~]# /etc/init.d/oddjobd status
oddjobd is stopped
[root@testserver ~]# /etc/init.d/oddjobd restart
Shutting down oddjobd:                                           [FAILED]
Starting oddjobd:                                                       [  OK  ]
[root@testserver ~]# /etc/init.d/oddjobd restart
Shutting down oddjobd:                                            [  OK  ]
Starting oddjobd:                                                       [  OK  ]
[root@testserver ~]# chkconfig oddjobd on

[root@testserver ~]# cat /etc/pam.d/sshd |  grep -i pam_oddjob_mkhomedir.so
#%PAM-1.0
session    required     pam_oddjob_mkhomedir.so

[root@testserver ~]# authconfig-tui
Here, disable (unselect)  the Use LDAP Authentication and save

[root@testserver ~]# authconfig-tui
Here, Enable (Select) the Use LDAP authentication and save. The result will be like below.
Starting nscd:                                             [  OK  ]
Starting nslcd:                                            [  OK  ]

Wednesday, December 6, 2017

Integrated Lights Out Manager Command to Turn On or Turn Off the Locator Indicator Remotely

Wednesday, December 06, 2017 0

Integrated Lights Out Manager Command  to Turn On or Turn Off  the Locator Indicator Remotely  

Below  Integrated Lights Out Manager Command is used to Turn On or Turn Off  the locator indicator .

Turn on the Locator indicator, type the following command at the  ILOM prompt:
set /System/ locator_indicator=on

Turn off the Locator indicator, type the following command at the ILOM prompt:
set /System/ locator_indicator=off

–> show /System/ locator_indicator

The output of the command appears:

/System

Properties:

locator_indicator = Off

The value locator_indicator shows the status as either On or Off.

Tuesday, December 5, 2017

How do you findout the Hardware and CPU Architecture BIT value in Linux

Tuesday, December 05, 2017 0

Findout the Hardware and CPU Architecture BIT value in Linux 

We can check the Hardware and CPU Supporting architecture by using below commands in Linux.

lscpu - display information about the CPU architecture
[root@testserver ~]# lscpu | egrep -i "CPU|Arch"
Architecture:                 x86_64
CPU op-mode(s):        32-bit, 64-bit
[root@testserver ~]#

[root@testserver ~]# file /sbin/init
/sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

 Print machine architecture.
[root@testserver ~]# arch
x86_64

uname - print system information
 -m, --machine    print the machine hardware name
[root@testserver ~]# uname -m
x86_64

-p, --processor   print the processor type or "unknown"
[root@testserver ~]# uname -p
x86_64

-i, --hardware-platform   print the hardware platform or "unknown"
[root@testserver ~]# uname -i
x86_64

getconf - get configuration values
[root@testserver ~]# getconf LONG_BIT
64

Monday, December 4, 2017

SSH password less authentication between inux server by using ssh keygen

Monday, December 04, 2017 0
ssh (SSH client) is a program for logging into a remote machine and for executing commands on a remote machine.  It is intended to replace rlogin and rsh, and provide secure encrypted communications between two untrusted hosts over an insecure network.

SSH server : 10.0.0.35
SSH Remote server : 10.0.0.40

Here we are going to setup password less authentication from SSH server to SSH Remote Server.

SSH KEYGEN: ssh-keygen generates, manages and converts authentication keys for ssh.  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.

Genarate Keys on Server 10.0.0.35

[linvirtshell@nsk ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/linvirtshell/.ssh/id_rsa):
Created directory '/home/linvirtshell/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/linvirtshell/.ssh/id_rsa.
Your public key has been saved in /home/linvirtshell/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:8fcOx3W45JXn3651mNDK+YvL0b3jn8382MhXRFiUQ44 linvirtshell@nsk
The key's randomart image is:
+---[RSA 2048]----+
|              .=+|
|              +o.|
|        .    E o.|
|         o   . .o|
|        S . o +o=|
|           o X O+|
|            * X *|
|           . O OO|
|            +.XO#|
+----[SHA256]-----+
[linvirtshell@nsk ~]$

Create .ssh directory on Remote Server (10.0.0.40)

Login to the server 10.0.0.40 and create .ssh directory under /home/nsk
[nsk@nsk .ssh]$ mkdir .ssh
[nsk@nsk .ssh]$ ls -al | grep -i .ssh
drwx------. 2 nsk nsk  6 Dec  4 11:25 .ssh

Here .ssh should be 0700 permission, under .ssh create authorized_keys file, it should be 0600 permission.

Now copy the id_rsa.pub key  from 10.0.0.35 and paste the same in authorized_keys  file in 10.0.0.40.

Now login from server 10.0.0.35 to 10.0.0.40 as user nsk

[linvirtshell@nsk ~]$ ssh nsk@10.0.0.40
Last login: Mon Dec  4 11:39:20 2017 from nsk
[nsk@nsk ~]$

Sunday, December 3, 2017

Linux server manual patching by using yum step by step

Sunday, December 03, 2017 0

Linux server manual patching by using yum  step by step

Follow the below steps to complete the manual patching of Linux server.

$ yum -y update yum >/dev/null 2>&1
$ yum -y update libstdc++ >/dev/null 2>&1
$ yum -y update kernel glibc >/dev/null 2>&1
$ yum -y update >/dev/null 2>&1

>       - redirect
/dev/null -  black hole where any data sent, will be discarded
2    - file descriptor for Standard Error
>    - redirect
&    - symbol for file descriptor (without it, the following 1 would be considered a filename)
1    - file descriptor for Standard Out

So  >/dev/null 2>&1 is redirect the output of your program to /dev/null. Include both the Standard Error and Standard Out. For more info refer Linux I/O redirection.

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.