Explore information related to ssh


Invalid cPanel License Error - Ways to fix it ?


This article covers the best way to tackle cPanel license error. In fact, this provides the fix should you log in to your WHM/cPanel and find a 'trial license' message or find yourself unable to log in due to an invalid or expired license.

Read More



Connect Amazon EC2 using putty - Follow these steps


This article covers the step you should follow to connect Amazon EC2 using putty.


How to Generate a PuTTY Private Key (.ppk) File ?

  • Download and install PuTTY.
  • Open the folder that PuTTY was installed to (default path is C: > Program Files > PuTTY).
  • Double-click on the file puttygen.exe.
  • In PuTTY Key Generator, click the Load button and navigate to the folder that contains the private key file (.pem) created during the EC2 configuration process.
  • Click on the PuTTY Private Key Files button in the lower-right corner of the window and select All Files (*.*).
  • Select your private key file (.pem) and click Open.
  • Click OK to close the PuTTYgen Notice pop-up window.
  • In PuTTY Key Generator, make sure Type of key to generate value is set to RSA.
  • Click Save private key and then Yes to close the PuTTYgen Warning pop-up.
  • Navigate to the location you want to store your PuTTY Private Key file (.ppk) and give it a name.
  • Click Save.
  • Close the PuTTY Key Generator window.


What is Amazon EC2 Instance?

1. Amazon EC2 instance is the varying combinations of CPU, memory, storage, and networking capacity that allow you to run your websites.

2. The best part of the Amazon EC2 instance is that it will allow you to scale your resources to the requirements of your target workload.

Read More



AWS EC2 docker permission denied


This article covers methods to resolve AWS EC2 docker permission denied error.

To give docker user enough permission, do the following:

You can try adding prod-user to group Docker:

$ sudo usermod -a -G docker $USER

usermod is a command that modifies the system configuration for a specific user.

-a is a shortcut for --append: It means append the group to the list of groups the user belongs to.

-G is a shortcut for --groups: It tells usermod that the next argument is a group.

docker is the group we want to add $USER to.

$USER is the user that we want to modify.

If this alone doesn't resolve the issue then try below :

$ chmod 664 /var/run/docker.sock ## First try this.
$ chmod 777 /var/run/docker.sock ## Then this. Not recommended though due to full permission.

Read More



Amazon EC2 refused to connect error – Fix it now


This article covers methods to resolve "Connection refused" or "Connection timed out" errors  which is noticed when trying to connect to my Amazon EC2 instance using SSH. In fact, this error indicates that the server didn't respond to the client and the client program gave up (timed out).


Common causes for "Connection refused" or "Connection timed out" EC2 AWS errors:

  • The security group or network ACL doesn't allow access.
  • There is a firewall on the instance's operating system.
  • There is a firewall between the client and the server.
  • The host doesn't exist.

Read More



Monitor MongoDB with Nagios XI - How to perform this ?


This article covers  how to monitor a MongoDB server with Nagios XI using the MongoDB Server Configuration Wizard in order to monitor the health of your server. The

wizard supplies checks to monitor the following: number of queries per second, memory usage, the number of databases on the server, and percentage of free connections available.


To Connect to MongoDB with the appropriate privileges:

Connect to mongod or mongos with the privileges specified in the Prerequisites section.

The following procedure uses the myUserAdmin created in Enable Access Control:

mongo --port 27017 -u myUserAdmin -p 'abc123' --authenticationDatabase 'admin'

The myUserAdmin has privileges to create roles in the admin as well as other databases.


To Modify Access for an Existing User in MongoDB:

  • You must have the grantRole action on a database to grant a role on that database.
  • You must have the revokeRole action on a database to revoke a role on that database.
  • To view a role's information, you must be either explicitly granted the role or must have the viewRole action on the role's database.

Read More



Digitalocean err_connection_refused - Fix it Now ?


This article covers methods to resolve DigitalOcean error. SSH service uses sshd daemon to listen to the incoming connections and handles user authentication, terminal connections, and many more. If this service crashes, the connection fails, and results in SSH Connection refused error in DigitalOcean servers.

To fix this error, start by identifying and researching on the root cause of service failures. 

The reasons can be traffic impales, disk errors, resource breakdowns, DDoS attacks, and many more.

Sometimes the backend service fails or doesn't respond. 

In this case, we kill the dead process and restart the service. 

For example, In CentOS 7 droplet, we restart the SSH service using the below command:

$ systemctl restart sshd

Read More



Configure inbound checks with Nagios – How to do it ?


This article covers how to easily configure inbound checks using both these APIs. Basically, there are two APIs available to handle inbound check transfers in Nagios XI:

  • NRDP - This api works on port 80 (HTTP) or 443 (HTTPS).
  • NSCA - This api works on TCP port 5667.


This will guide Nagios Administrators that needs to configure inbound checks.

Read More



Install Joomla in CloudPanel - Step by Step Process ?


This article covers how to Install Joomla in CloudPanel control Panel. Basically, Joomla  is a free and open-source content management system for publishing web content on websites.


Step by Step how to setup Joomla 3.9 with CloudPanel:

1. Login via SSH to the server e.g. with john-ssh and go to the users tmp directory:

$ cd ~/tmp

2. Download and extract the latest Joomla 3.9 version.

$ mkdir ~/tmp/joomla-3.9 && curl -sL https://downloads.joomla.org/cms/joomla3/3-9-25/Joomla_3-9-25-Stable-Full_Package.tar.gz | tar xfz - -C ~/tmp/joomla-3.9/

3. Move files to the htdocs directory of the domain:

$ cp -R joomla-3.9/* /home/cloudpanel/htdocs/www.domain.com/

4. Reset permissions.

$ cd /home/cloudpanel/htdocs/
$ clpctl system:permissions:reset www.domain.com 775

5. Clean up the tmp directory.

rm -rf ~/tmp/*

6. Open your domain in the browser and go through the installation wizard.

7. Done! Joomla 3.9 is now installed.

Read More



Apache Error: "semget: No space left on device" - Fix it Now ?


This article covers methods to resolve Apache Error: "semget: No space left on device". This error indicates that apache failed and will not start again, so check the error log If you see an error similar to the following, it could indicate that your server has run out of semaphores and apache cannot be started:

[emerg] (12)Cannot allocate memory: mod_fcgid: Create process manager error
[error] (28)No space left on device: Cannot create SSLMutex Configuration Failed


To solve this problem you can restart Apache, Postgres and other services that consumer many IPC resources or increase limit of the resources in the system using 'sysctl'. When you stop all services the semaphores and shared memory segments have to be removed, if not, and you still able to see them using 'ipcs' command, try to remove them manually using 'ipcrm' command. 

1. For example to remove semaphore:

# ipcs -a

2. If this is a common problem for you, you may want to increase the semaphore limits on your VPS server. You can do that by adding the following to the /etc/sysctl.conf file:

# Increases the semaphore limits & extend Apache's uptime.

kernel.msgmni = 512
kernel.sem = 250 128000 32 512

3. Then load the new settings into the kernel:

sysctl -p

Read More



Nagios – Monitor hosts using SSH: How to use the plugin ?


This article covers how to monitor Nagios using SSH. 

In order to monitor Linux hosts using the Nagios check_by_ssh plugin, there are a few prerequisites that must be met:

  • Create a Nagios user for monitoring on the host to be monitored.
  • Configure passwordless SSH authentication as nagios user on host to monitor.
  • Install Nagios plugins on the host to monitor.


To Create a Nagios user:

Login to the host to monitor and create a user called nagios and set the login password.

useradd -m nagios
passwd nagios

Read More



Modify the Default SSH Port on any Linux Distribution - Step by Step Process ?


This article covers how to change the default SSH port on your Linux machine.

To change the default port the SSHD daemon is listening on.

We can edit the configuration file using a nano editor:

$ sudo nano /etc/ssh/sshd_config

Once you make a change to the SSHD daemon configuration file, you should restart the services to reload the new changes.

$ sudo service sshd restart

Read More



Clear Solaris Service Maintenance Status in Nagios - Troubleshoot and Resolve


This article covers how to fix Clear Solaris Service Maintenance Status Nagios issue. Basically, When the Nagios Core service finds an invalid configuration, the core service will not start. 

To fix the problem you must fix the problem Nagios Core is complaining about.

This is normal behavior of Nagios Core, it is not specific to Solaris.

However on Solaris, after a service has failed to start several times, Solaris will put the service into what is called a Maintenance State. This state prevents a small problem from becoming a bigger problem. 

Even after fixing the problem Nagios Core is complaining about, you must also clear the maintenance state on the service before Solaris allows a service to be started again.

This means that the service is in a maintenance state, however there is not a lot of detail as to the cause of the issue except that the Start method failed repeatedly. 

It does however provide the name of a log file /var/svc/log/application-nagios:default.log.

Execute the following command to perform further troubleshooting:

tail -20 /var/svc/log/application-nagios:default.log


To Clear Maintenance State on Nagios:

1. Run the following command to clear the maintenance state:

$ svcadm clear nagios

2. Execute the following command to start Nagios:

$ svcadm enable nagios

3. Now check the state of the service:

$ svcs -xv nagios

Read More



SSH Servers Clients and Keys - More about it now


This article covers important information about SSH Servers, Clients and Keys. Use SSH keys for authentication when you are connecting to your server, or even between your servers.

They can greatly simplify and increase the security of your login process. 

When keys are implemented correctly they provide a secure, fast, and easy way of accessing your cloud server.


Turn off password authentication Linux:

With SSH key authentication configured and tested, you can disable password authentication for SSH all together to prevent brute-forcing. When logged in to your cloud server.

1. Open the SSH configuration file with the following command.

$ sudo nano /etc/ssh/sshd_config

2. Set the password authentication to no to disable clear text passwords.

PasswordAuthentication no

3. Check that public key authentication is enabled, just to be safe and not get locked out from your server. If you do find yourself unable to log in with SSH, you can always use the Web terminal control panel.

PubkeyAuthentication yes

Then save and exit the editor.

4. Restart the SSH service to apply the changes by using the command below.

$ sudo systemctl restart sshd

With that done your cloud server is now another step along towards security. 

Malicious attempts to connect to your server will results in authentication rejection, as plain passwords are not allowed, and brute-forcing an RSA key is practically impossible.

Read More



Ansible error Shared connection to server closed


This article covers the Shared connection to server closed error which occur when we run an Ansible command to execute commands on two newly deployed CentOS 8 servers.
Ansible is an open-source automation tool, or platform, used for IT tasks such as configuration management, application deployment, intraservice orchestration, and provisioning.
While you can write Ansible modules in any language, most Ansible modules are written in Python, including the ones central to letting Ansible work. By default, Ansible assumes it can find a /usr/bin/python on your remote system that is either Python2, version 2.6 or higher or Python3, 3.5 or higher.

A quick fix to Ansible error Shared connection to server closed is to just add the path to python 3 in your inventory file.
It would look something like this:
ip_address ansible_python_interpreter=/usr/bin/python3
Then you could test if it works with the ping module:
ansible -m ping all

From the error details, the connection failed because the shell(s) in the remote system couldn't find the Python interpreter (/usr/bin/python) as indicated by the line: "module_stdout": "/bin/sh: /usr/bin/python: No such file or directory\r\n".
After checking the remote hosts, we discovered that the systems don't have Python 2 installed.
Check Python Binary
They have Python 3 installed by default and its binary is /usr/bin/python3.

According to the Ansible documentation, Ansible (2.5 and above) works with Python version 3 and above only.
Also, Ansible is supposed to automatically detect and use Python 3 on many platforms that ship with it.
However, if it fails to, then you can explicitly configure a Python 3 interpreter by setting the ansible_python_interpreter inventory variable at a group or host level to the location of a Python 3 interpreter.

Read More



AWS error code 0x204


This article will guide you on methods to fix AWS #error code 0x204 which happens in the process of trying to login to a remote machine on VPC.

Amazon Virtual Private #Cloud (Amazon #VPC) is a service that lets you launch AWS resources in a logically isolated virtual network that you define. You can use both IPv4 and IPv6 for most resources in your virtual private cloud, helping to ensure secure and easy access to resources and applications.


To enable RDP access on AWS instance:

i. Open the Amazon EC2 console , set it to the stack's region, and choose Security Groups from the navigation pane. 

ii. Choose AWS-OpsWorks-RDP-Server, choose the Inbound tab, and choose Edit. 

iii. Choose Add Rule and specify the following settings: Type – RDP.


To connect from the #Amazon EC2 console:

1. Open the Amazon #EC2 console.

2. In the left navigation pane, choose Instances and select the instance to which to connect.

3. Choose Connect.

4. On the Connect To Your Instance page, choose EC2 Instance Connect (browser-based SSH connection), Connect.

Read More



SSH Connection Refused


This article will guide you on how to resolve SSH connection error occur.

Sometimes while connecting to SSH servers, users often encounter "Connection refused" error by port 22. It happens because of several reasons like SSH service is not running, the port is blocked by the firewall, or the server is using a different port. 

It can also occur because of the IP conflict issue.

To SSH on Ubuntu, Open your terminal either by using the Ctrl+Alt+T keyboard shortcut or by clicking on the terminal icon and install the openssh-server package by typing: sudo apt update sudo apt install openssh-server. Once the installation is completed, the SSH service will start automatically.

To resolve ssh connection refused:

1. Install an SSH tool such as OpenSSH on the server you want to connect to using the sudo apt install openssh-server command. 

2. If your firewall is blocking your SSH connection. Disable the firewall rules blocking your SSH connection by changing the destination port's settings to ACCEPT.

Read More



Preserve Permissions in rsync


This article will guide you on how to use rsync to preserve permissions. 

Rsync, or Remote #Sync, is a free command-line tool that lets you transfer files and directories to local and remote destinations. #Rsync is used for mirroring, performing backups, or migrating data to other servers.

a = archive - means it preserves #permissions (owners, groups), times, symbolic links, and devices. Use of "/" at the end of path: When using "/" at the end of source, rsync will copy the content of the last folder.

To preserve permissions when files and folders are copied or moved, use the Xcopy.exe utility with the /O or the /X switch. 

The object's original permissions will be added to inheritable permissions in the new location.

To make rsync to preserve timestamps:

1. To overcome this, there is another option that you can specify in the rsync command that will preserve the timestamps during the synchronization process. 

2. Without preserving the timestamp, the files will display the modification date and time as the time that the rsync command was run.

Read More



Install and Configure OpenSSH on windows


This article will guide you on steps to install and configure #OpenSSH on #windows. Also, we saw some common errors relating to OpenSSH.

OpenSSH is the premier connectivity tool for remote login with the #SSH protocol. It encrypts all traffic to eliminate eavesdropping, connection hijacking, and other attacks.

i. To install OpenSSH, start Settings then go to Apps > Apps and Features > Manage Optional Features. 

ii. Scan this list to see if OpenSSH client is already installed. 

iii. If not, then at the top of the page select "Add a feature", then: To install the OpenSSH client, locate "OpenSSH Client", then click "Install".

To Enable the OpenSSH Server in Windows 10:

1. Open the #Settings app and go to #Apps -> Apps & features.

2. On the right, click Manage optional features.

3. On the next page, click the button Add a feature.

4. In the list of features, select OpenSSH Server and click on the Install button.

5. Restart Windows 10.

Read More



Transfer Files with Rsync on Windows using SSH connection


This article will guide you on steps to perform Rsync from Windows to Linux over SSH.

#Rsync can use #SSH as a secure transport agent. Make sure rsync is installed by opening a #terminal session and typing rsync --version on each machine.

Most #Linux distributions can now read the FAT32 or NTFS disk formats natively, so you could copy your files to an external hard drive formatted in Windows with either of those file systems, which will then allow you to read the data back easily in Linux.

1. cwRsync is an implementation of rsync for Windows. 

2. rsync uses a #file #transfer technology specified by the rsync algorithm, transferring only changed chunks of files over the network. 

3. #cwRsync can be used for remote file #backup and #synchronization from/to Windows systems.

Read More



New files of configuration for Apache error in Plesk


This article will guide you on methods to fix the Plesk error : new files of configuration for Apache.
The causes of this Plesk error:
1. Mailman package is not installed.
2. Database related error.
3. PHP memory issue.
To fix this Plesk issue:
Mailman package is not installed
When you try to reconfigure the domain, you will get the following error.
# /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
No valid mailman bindir detected
So, in this case it is clear that the issue is causing because the mailman package is missing.
To fix the issue, you can follow the steps mentioned below.
a) Download and install the mailman package from  http://autoinstall.plesk.com
b) After that remove all entries from the ‘Configurations’ table of the ‘psa’ database.
mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e"delete from Configurations"
c) Remove all ‘Include’ records from configuration files and all content from the directory below:
# sed -i /Include/d /usr/local/psa/admin/conf/ip_vhosts_bootstrap.conf&& sed -i /Include/d /usr/local/psa/admin/conf/vhosts_bootstrap.conf&& sed -i /include/d /usr/local/psa/admin/conf/nginx_vhosts_bootstrap.conf&& sed -i /Include/d /usr/local/psa/admin/conf/webmail_horde_bootstrap.conf&& sed -i /Include/d /usr/local/psa/admin/conf/webmail_atmail_bootstrap.conf&& sed -i /Include/d /etc/httpd/conf.d/zz010_psa_httpd.conf&& rm -f /usr/local/psa/admin/conf/generated/*
d) Now you can reconfigure and that will fix the issues.
/usr/local/psa/admin/bin/httpdmng --reconfigure-all
This will resolve the error.

Read More



Deploy Node js Application to DigitalOcean Server


This article will guide you on how to  deploy node.js application to #DigitalOcean Server.  

To Deploying #Node . js application to DigitalOcean — Setting up the #server:

1. Getting familiar with Digital Ocean and creating your first #droplet.

2. Setting up #SSH and connecting to your server from your local #machine.

3. Setting up a simple Express.js web-server in local machine.

4. Using #Git to deploy your code to server.

Read More



Steps To Harden OpenSSH Client on Ubuntu 18 04


This article will guide you on how to harden #OpenSSH Client by following some quick and easy steps.
#Hardening of the #OS is the act of configuring an OS securely, updating it, creating #rules and #policies to help govern the system in a secure manner, and removing unnecessary applications and services. This is done to minimize a computer OS's exposure to threats and to mitigate possible #risk.

Read More



How to enable SSH access on DirectAdmin


This article will help you know the best method to enable ssh access for a user in DirectAdmin control panel and also fix common issues encountered while creating a user to use with SSH.

Read More




For Linux Tutorials

We create Linux HowTos and Tutorials for Sys Admins. Visit us on LinuxAPT.com

Also for Tech related tips, Visit forum.outsourcepath.com or General Technical tips on www.outsourcepath.com






Focus on your business, not your servers.

Click Here to Learn More