November 19

Linux: Error: Unable to fetch my node definition, but the agent run will continue

Puppet agent is giving the following error:
puppet agent -tv
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: SSL_connect SYSCALL returned=5 errno=0 state=unknown state
Info: Retrieving pluginfacts
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Failed to generate additional resources using ‘eval_generate’: SSL_connect SYSCALL returned=5 errno=0 state=unknown state
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet:///pluginfacts: SSL_connect SYSCALL returned=5 errno=0 state=unknown state
Info: Retrieving plugin
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Failed to generate additional resources using ‘eval_generate’: SSL_connect SYSCALL returned=5 errno=0 state=unknown state
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: SSL_connect SYSCALL returned=5 errno=0 state=unknown state
Info: Loading facts
Error: Could not retrieve catalog from remote server: SSL_connect SYSCALL returned=5 errno=0 state=unknown state
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Error: Could not send report: SSL_connect SYSCALL returned=5 errno=0 state=unknown state

Fix:
On the puppet master server:
puppet cert clean agentservername

On the Agent server:
rm -rf /etc/puppetlabs/puppet/ssl/
puppet agent -tv

On the puppet master server:
puppet cert sign –all

On the Agent server:
puppet agent -tv

Category: Linux | Comments Off on Linux: Error: Unable to fetch my node definition, but the agent run will continue
November 19

Linux: Exiting an SSH connection

ESCAPE CHARACTERS
When a pseudo-terminal has been requested, ssh supports a number of
functions through the use of an escape character.

 A single tilde character can be sent as ~~ or by following the tilde by
 a character other than those described below.  The escape character
 must always follow a newline to be interpreted as special.  The escape
 character can be changed in configuration files using the EscapeChar
 configuration directive or on the command line by the -e option.

 The supported escapes (assuming the default ‘~’) are:

 ~.      Disconnect.

 ~^Z     Background ssh.

 ~#      List forwarded connections.

 ~&      Background ssh at logout when waiting for forwarded connection
         / X11 sessions to terminate.

 ~?      Display a list of escape characters.

 ~B      Send a BREAK to the remote system (only useful if the peer sup‐
         ports it).

 ~C      Open command line.  Currently this allows the addition of port
         forwardings using the -L, -R and -D options (see above).  It
         also allows the cancellation of existing port-forwardings with
         -KL[bind_address:]port for local, -KR[bind_address:]port for
         remote and -KD[bind_address:]port for dynamic port-forwardings.
         !command allows the user to execute a local command if the
         PermitLocalCommand option is enabled in ssh_config(5).  Basic
         help is available, using the -h option.

 ~R      Request rekeying of the connection (only useful if the peer
         supports it).

 ~V      Decrease the verbosity (LogLevel) when errors are being written
         to stderr.

 ~v      Increase the verbosity (LogLevel) when errors are being written
         to stderr.
Category: Linux | Comments Off on Linux: Exiting an SSH connection
November 19

Linux: Upgrading PHP 5.4 to PHP 5.6 via RHSCL but the php version still shows as 5.4

You need to use scl enable to add PHP 5.6 to your environment. 

To start using the software collection rh-php56 you need to enable it using the below command.

# scl enable rh-php56 bash

After this please check the output of below command:

# php -v

Also make sure to add this permanently to your environment variable as this setting will only remain until reboot.

To make one or more RHSCL packages a permanent part of your development environment, you can add it to the login script for your specific user ID. this is the recommend approach for development as only processes run under your user ID will be affected.

Add the following line to your ~/.bashrc:

vi ~/.bashrc

# Add PHP 56 from RHSCL to my login environment:
source scl_source enable rh-php56

After making the change, you should log out and log back in again.

Note: When you deliver an application that uses RHSCL packages, a best practice is to have your startup script handle the scl enable step for your application. You should not ask your users to change their environment as this is likely to create conflicts with other applications.
Category: Linux | Comments Off on Linux: Upgrading PHP 5.4 to PHP 5.6 via RHSCL but the php version still shows as 5.4
November 19

Linux: SSH issues on Kali

Starting SSH on boot Kali 2.x

SSH won’t start at boot on Kali 2.0?

Don’t worry, it’s because Kali 2.x is based on Debian 8, as opposed to Kali 1.x being based on Debian 7.

Kali 1.x uses init/update-rc.d;

Kali 2.x uses systemd/systemctl

For Kali 1.x, the command is

#update-rc.d -f ssh defaults

For Kali 2.x, the command is

#systemctl enable ssh.service
Starting ssh on boot kali 2.x
sudo systemctl enable ssh.service

And that’s it, you are done. Feel free to leave comments

By: Security

Category: Linux | Comments Off on Linux: SSH issues on Kali