techxplore blog

Error ssh: connect to host port 22: Connection refused

Have you ever encountered trying to connect remotely to an old Red Hat Linux release 7.3 (Valhalla) server via SSH, but is bugged by the error:

ssh: connect to host port 22: Connection refused.

Well it seems like it pertains to IP tables of the server as the primary suspect.

I checked the IP tables service and it is not even started.

$ sudo /etc/init.d/iptables status
Table: mangle
target prot opt source destination

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

target prot opt source destination
Table: filter
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Table: nat
target prot opt source destination

target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Anyway, I added some entries to allow connection from client IP, then started IP tables service.

$ sudo /etc/init.d/iptables start
Flushing all current rules and user defined chains: [ OK ]
Clearing all current rules and user defined chains: [ OK ]
Applying iptables firewall rules: [ OK ]
[ OK ]

I tested again SSH from the client computer but the error now changed:

$sudo ssh techexplore@
ssh: connect to host port 22: Connection refused

I tested SSH with the option -v for more output on the error and it shows:

$sudo ssh -v techexplore@
OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t 3 May 2016
debug1: Reading configuration data /root/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to [ ] port 22.
debug1: connect to address port 22: Connection refused
ssh: connect to host port 22: Connection refused

I tried also using telnet from the client computer but the error is the same:

$sudo telnet 22
telnet: Unable to connect to remote host: Connection refused

This definitely is not caused by IP tables service as the error is thrown whether the service is up or down. The next thing to check is the security based on Linux system itself. There’s a simple access control language Linux that is based on client (host name/address, user name), and server (process name, host name/address) patterns. This is done by settings found in /etc/hosts.allow.

$sudo vi /etc/hosts.allow

This opened the file and it shows below: sshd access from limited client computer:

# hosts.allow This file describes the names of the hosts which are
# allowed to use the local INET services, as decided
# by the ‘/usr/sbin/tcpd’ server.


Checked the client IP address:

$sudo ifconfig
eth0 Link encap:Ethernet HWaddr -.-.-.-
RX packets:5346421 errors:0 dropped:19312 overruns:0 frame:0
TX packets:1235181 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2082590684 (1.9 GiB) TX bytes:219577341 (209.4 MiB)

lo Link encap:Local Loopback
inet addr: Mask:
inet6 addr: ::1/128 Scope:Host
RX packets:369252 errors:0 dropped:0 overruns:0 frame:0
TX packets:369252 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:968658293 (923.7 MiB) TX bytes:968658293 (923.7 MiB)

tap100i0 Link encap:Ethernet HWaddr -.-.-.-
RX packets:3005498 errors:0 dropped:0 overruns:0 frame:0
TX packets:7270485 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1420176662 (1.3 GiB) TX bytes:2221103471 (2.0 GiB)

vmbr0 Link encap:Ethernet HWaddr -.-.-.-
inet addr: Bcast: Mask:
inet6 addr: -.-.-.- Scope:Link
RX packets:3038626 errors:0 dropped:0 overruns:0 frame:0
TX packets:2310358 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1328586130 (1.2 GiB) TX bytes:249736614 (238.1 MiB)


The client IP address is, then add this to the /etc/hosts.allow file.

$sudo vi /etc/hosts.allow

Edit the file, add on the last line and save:

# hosts.allow This file describes the names of the hosts which are
# allowed to use the local INET services, as decided
# by the ‘/usr/sbin/tcpd’ server.

# SSH access only from selected computers


Changes will not work until restarting the SSHD service.

Restart the sshd service with the following:

$sudo /etc/init.d/sshd reload

After restart ssh from client machine worked.



Setting Linux CentOS 7.2 Date Timezone

A correct date time in a newly installed server is important, but it’s overlooked sometimes until it cause some strange problems in synchronization of data between servers.

Here’s a simple guide to remember in setting Linux CentOS 7.2 date timezone.

Check the current date/timezone:
# date
Thu Aug 25 02:42:13 UTC 2016

Check available timezone:
# timedatectl list-timezones


Check available timezone from Asia:
# timedatectl list-timezones | grep Asia


Set timezone to Asia/Bangkok:
# timedatectl set-timezone Asia/Bangkok

Check again the current date/timezone:
# date
Thu Aug 25 11:03:19 ICT 2016

The command timedatectl basically created a symlink between /etc/localtime to the desired timezone file in the system located in /usr/share/zoneinfo/ directory.

The link can be verified:
# ls -l /etc/localtime
lrwxrwxrwx 1 root root 34 Aug 25 11:03 /etc/localtime -> ../usr/share/zoneinfo/Asia/Bangkok

Thus, another way to set the date timezone by removing the existing localtime file:
#rm /etc/localtime

Create a new localtime file symbolic link to the timezone:
#ln -s /usr/share/zoneinfo/Asia/Bangkok /etc/localtime

Verify again the link:
# ls -l /etc/localtime
/etc/localtime -> ../usr/share/zoneinfo/Asia/Bangkok

That concludes the steps in setting up Linux CentOS 7.2 Date Timezone and it might apply to other version of CentOS.


Centos 6.7 could not retrieve mirrorlist pycurl error 77 SSL CA cert problem

Upgrading software sometimes could be a challenging experience. Login as root in Centos 6.7, a simple “yum -y update” command stalled. The error thrown was it Could not retrieve the mirrorlist from webtatic and could not find the base URL for the repository. It also indicated some pycurl error about SSL CA certificate.

Now, I tried the basic troubleshooting of verifying network settings, connectivity, dns resolution and it all works fine. This occurred after uninstalling Zpanel control panel and deleting some certificates that the error suddenly appeared. Thus, the error could be about SSL CA certificate as indicated by pycurl error 77. It seems like the /etc/pki/tls/certs/ content is broken/messed up after uninstall.

The solution that worked for fixing the error was outlined in the “Fixing CentOS Root Certificate Authority Issues“.

The solution was to download a new certificate bundle.
Running as root the following command:
# curl -o /etc/pki/tls/certs/ca-bundle.crt
This resolved the error and I could run the “yum -y update” command without any issue.

Just to be sure that everything is updated okay, I’ve reinstalled openssl and ca-certificates:
# yum reinstall openssl
# yum reinstall ca-certificates


Free Visual Studio Community Software as Professional

Programmers have a variety of tools available to choose from. Some of the best tools allows for a programmer to use it on different operating systems and it’s also for free.

That’s what Visual Studio Community computer software is all about. A rich, integrated development environment for creating applications for Windows, iOS, and Android. It can also be used as well in modern web applications and cloud services.

Previously programmers are faced between two flavors, Visual Studio Premium and Professional, but the good news is for those who long to use the tool is it was replaced by Visual Studio Community. The Visual Studio Community version is not a trial version, nor an Express-style narrowly limited product, but it is the same as Visual Studio Professional. The only exception is that it doesn’t include CodeLens feature. No need for product key as it is activated through a Microsoft Account.

Visual Studio Community 2015 is a free, full-featured IDE with highlighting, coding components, cross-stage portable features that can be used for Windows, Android, and iOS for web and cloud implementations. In short, this version of Visual Studio is accessible for nothing for individual designers, scholastic exploration, open source improvement, training and more.

It’s a programmers bonus to have Visual Studio Community as a software tool in accomplishing day to day task.

Download Visual Studio Community Software:


One of The Best Affordable Cloud Storage Available Microsoft OneDrive

A lot of us have collected online a stockpile of an immense amounts of photographs, music & video recordings, and other files for archives.

Putting all those software and media files in one place online is the practical thing to do for accessibility from different locations.  This is called placing files in the cloud where you don’t need to be stressed over by which machine they’re on or whether they’re up and running or not. They’re literally accessible on any gadget from anyplace. Thus, there’s little need to be stressed over losing them if one of those gadgets goes down.

The main challenge is to select the best online storage available out of the numerous cloud providers ranging from Microsoft, Apple, Google and others. Deciding upon which is a good fit for your current needs is mind boggling.

The main consideration usually is cost in my case. Thus, when it comes to the most affordable option, Microsoft OneDrive is on the top of the list. It offers very cheap storage. More over it is coupled with free office suite software application like MS Word, MS Excel, MS PowerPoint and other productivity apps which is very useful in day to day work.

Microsoft One Drive is available at 1 TB storage which seems to be an excessive amount of capacity for an individual user for only $7 monthly fee. Also, Microsoft likewise offers a 50 GB storage space for $2 every month.  In the event that one prefers not to pay for distributed storage by any means, Microsoft have a 5 GB of free space.

After due consideration, Microsoft OneDrive comes as the best fit for Cloud Storage for personal use.



Install Linux Container (LXC) in Oracle Linux 6.4

Virtualization solutions offers a popular solution for our work use in beta testing applications and system installation. I’ve encountered Linux Containers or LXC which is something relatively new which is a hybrid of chroot and full virtual machine.

LXC is a userspace interface for the Linux kernel containment features. Through a powerful API and simple tools, it lets Linux users easily create and manage system or application containers.


Thus, I’ve explored to install this on Oracle Linux 6.4. The steps for Linux Container installation is pretty simple.

1. Login as root
2. Set the appropriate repository
# cd /etc/yum.repos.d
# wget
3. Install LXC
# yum install lxc
4. Check LXC installation
# rpm -qa lxc

After installation I could now create Linux containers in Oracle Linux 6.4 as intended.


Linux Zpanel KFM Module Increase File Upload Limit

Zpanel web hosting manager includes a lot of installable module. I find Kae’s File Manager module to be very useful. The default upload file size seems to be limited to 2Mb. Thus, it needs to be configured to allow bigger file uploads.

The way to increase KFM module file upload limit is to edit the php.ini file. The file is located under “/etc” folder. I plan to increase the file upload limit size to 25Mb. The following variables need to be adjusted upload_max_filesize, post_max_size, max_execution_time, and max_input_time.

Using the Vi text editor:
# vi /etc/php.ini

I’ve set it accordingly the parameters as follows:
upload_max_filesize = 25M
post_max_size = 25M
max_execution_time = 120
max_input_time = 60

I restarted the httpd service for the new settings to take effect.
# /etc/init.d/httpd restart

I open up the web hosting panel KFM file manager and tested file uploads until 25Mb and it worked fine to my delight.


Linux Sudo Copy File Preserve Permission Date Stamp

A simple day to day task in using a computer such as copying a file could be daunting in a new environment. Well a friend new to Linux operating system is blown away with such a task. A person who is accustomed to GUI (Graphic User Interface) environment like MS Windows operating system freaks out.

Anyway, copying a file in Linux is usually done via “cp” command. Some systems does not allow use of “cp” command. It should be done via “sudo” (allow a super user to do on ones behalf).
$sudo cp sourcefilename targetfilename

The above command requires that the user is in the list of “sudo” users. The problem with using such command is it changes the ownership to “root” and date stamp to system date. There are cases when we don’t want such scenario.

Thus, to preserve the ownership, permission, and date stamp the “cp” command is used with some parameters.
$sudo cp sourcefilename targetfilename -p

The added parameter “-p” tells “cp” command to preserve the ownership, permission, and date stamp.


Infor ERP alternative to Oracle E-Business Suite

Enterprise Resource Planning software is one of the important applications widely used in offices. Oracle E-Business Suite (Oracle ERP) is also among the popular ERP applications together with SAP. Recently though I’ve encountered a new ERP application from Infor. The Chief Executive Officer of Infor is Oracle’s Charles Phillips who was the former President of Oracle Corporation and a member of its Board of Directors. It’s interesting that Infor which is relatively new to the market have progressed rapidly in the recent years.

I’ve been using Oracle ERP E-Business Suite for several years already. There is this Java Run time application and a self-service web application which opens via the internet browser. It’s a problem we encounter with using the Java Runtime Environment (JRE) based application as it does not run on newer such as Windows 7 64 bit operating systems. Also some people are using portable devices already like tablets or iPads which does not support the Oracle Forms which are Java-based applications. The self-service web applications are working fine, but not the full feature is available.

Thus, we’ve looked for some alternative ERP which could adapt to the new technology. The one which caught our attention is Infor which introduces modern look and feel with innovation. There is a common visual interface whether you are using desktop, laptop, tablet or smartphone, offering a seamless experience.

In summary Infor ERP Advantage:
Streamline operations and get company-wide visibility.
Get access to information anytime, anywhere to improve decision making and speed response times.
Easily adapt to new manufacturing methods, changing customer requirements, and evolving business strategies.
Get new products to market more quickly and profitably.
Optimize inventory and production resources to increase efficiency.
Improve quality and customer satisfaction.
Source: Infor Website

The above advantages are considerations that make Infor ERP as a good alternative to Oracle ERP E-Business Suite.


Windows 8 Jinitiator Support for Oracle ERP Application

Oracle ERP are some of the most important applications we have at work. Mostly Oracle E-Business Suite financial modules are being used. We’ve been running Oracle 5.7.11 applications, but would like to use newer operating systems from Microsoft. The offices are using Windows operating system with corporate license which makes it easy for IT support to upgrade to newer operating system versions.

The biggest stumbling block in upgrading to newer operating systems like Windows 7 or Windows 8 are is the support for running Oracle ERP Applications. A lot of people are experiencing issues in working with Jinitiator. Some were having problems with jinitiator on Windows 7. Installing Jinitiator was without problems but every time applications are opened with browser (IE or Firefox) it hangs and close with error. Using compatibility mode (XP with SP3) is a hit and miss on some occasion with various browsers.

Oracle JInitiator last version 1.3 was desupported for EBS customer’s way back in July 2009. It was recommended to use the standard Sun JRE as per Oracle page below:

There’s clearly no coming support for Jinitiator for Windows 7 or Windows 8. It would be a major change for those facing the issue of using legacy Oracle EBS applications and newer Microsoft Windows operating system.