Tuesday, July 26, 2016

Error: uninitialized constant Superenv::HOMEBREW_ENV_PATH

If you are getting the following error while installing from brew then this post might help you:
 
$ sudo brew install gradle
Error: uninitialized constant Superenv::HOMEBREW_ENV_PATH
Please report this bug:
    https://git.io/brew-troubleshooting
/usr/local/Library/Homebrew/extend/os/mac/extend/ENV/super.rb:6:in `bin'
/usr/local/Library/Homebrew/extend/ENV.rb:7:in `superenv?'
/usr/local/Library/Homebrew/extend/ENV.rb:12:in `activate_extensions!'
/usr/local/Library/Homebrew/build.rb:80:in `install'
/usr/local/Library/Homebrew/build.rb:179:in `<main>'


For resolving this issue follow these steps :

=> Make brew executable own by root
    sudo chown root /usr/local/bin/brew

=> Now update brew 
       $ sudo update brew

=> Now install what you were installing, in my case it was gradle 
     $ sudo brew install gradle
   ==> Downloading https://downloads.gradle.org/distributions/gradle-2.14.1-bin.zip
    ######################################################################## 100.0%
🍺  /usr/local/Cellar/gradle/2.14.1: 171 files, 47.4M, built in 47 seconds


--
All the best!

Friday, March 20, 2015

Scom Linux(redhat/ubuntu/amazon) agent Registration Failed.

Hey All
 if you are getting error like below while installing scom agent on linux



Task invocation failed with error code -2130771918. Error message was: The SCXCertWriteAction module encountered a DoProcess exception. The workflow Microsoft.Unix.Agent.GetCert.Task has been unloaded.
Module: SCXCertWriteAction
Location: DoProcess
Exception type: ScxCertLibException
Exception message: Unable to create certificate context
; {ASN1 bad tag value met.
}

Additional data: Sudo path: /usr/bin/
Management group: Ours
Workflow name: Microsoft.Unix.Agent.GetCert.Task
Object name: Unix Linux Monitoring Resource Pool
Object ID: {B1698091-E324-6C57-79B4-2BBF46ED2952}


Solution:

Check your resolv.conf file having path /etc/resolv.conf

check the domain line 

if the domain line has the domain listed like
domain abc.example.xyz. def.example.pqr.

remove the last dot character from the domain it should be like
domain abc.example.xyz def.example.pqr


try installing it again .

ALL THE BEST !!

Monday, February 24, 2014

Creating Key Based Authentication in Linux using SSH




If you don’t want to enter password every time you login into your linux system then you have to remove the password based authentication and start using certificate based authentication. If you are an AWS user then you must have seen that AWS provides key based authentication for linux operating systems.  You use the private key to authenticate yourself to the linux machine hosted in the AWS cloud.

Let’s start the drama

Step 1:  Key Pair Generation 

For generating key pair you can use puttygen.
Open puttygen  -> Click Generate button -> move mouse over the blank area shown in the figure below 




Save the public and private key by pressing the Save Public Key and Save Private Key button.


After saving the public and private keys go to Conversion file menu and press Export Openssh key  and save that key somewhere in your hard disk. 



Step 2: Exporting keys to liunx server.

In this step we will export the keys in linux host.
Login to the linux server by putty or whatever way you prefer. I’ll recommend putty and ssh.
Now, create a directory .ssh  if not exist, in the home directory of the user for which you want to allow key based authentication.  For example: for y user the directory path will be /home/y/.ssh.
Now create a file in .ssh directory with name as id_dsa

 

Paste the openssh key file you generated using putty in this id_dsa file  and then change the permission of id_dsa to 600
 


After this on the terminal inside .ssh directory run the commands as shown below







Now you have both public and private key as id_dsa.pub and id_dsa.

Now create a file authorized_keys in the same directory.



And paste the data of id_dsa.pub file into authorized_keys file.


 Step 3: Setting Authentication method
In this step we will set up key based method as the authentication method.
Open file /etc/ssh/sshd_config, search for PasswordAuthentication, remove the # from the beginning of the line and type no in place of yes and save and close the file.


                            

                           





Now you are done with the configuration .
Restart the ssh service and now try using the private key file for authentication from putty, this is the private key you generated after creation of the key pair.