Access shell with SSH on cPanel server from Linux

Discover an effective way to set PostgreSQL schemas using PHP PDO when the SET search_path approach fails. Learn best practices for schema-based architecture.

Some of the important server related problems will be solved only using shell access to the server. To access the cPanel server shell using SSH, there must be an SSH client installed on PC. Most of the Linux distros include SSH client software by default. If it is not installed, then it can be easily installed with following commands,

For Ubuntu: apt-get install openssh-client
For CentOS: yum install openssh-clients

After installation, follow these steps to access the cPanel shell with SSH from Linux:

  1. Login to cPanel and go to Security > SSH/Shell Access to generate SSH key pair.
  2. Click Manage SSH Keys > Generate a New Key. You should use a password to protect the key. You will be asked the password each time you use the key.
  3. In Public Keys section click ‘Manage Authorization’ and ‘Authorize’
  4. In Private Keys section click, Vew/Download then download the key (id_dsa or id_rsa) to your PC.
  5. Save it to ~/.ssh directory on your Linux machine under a meaningful name to not overwrite your existing keys for example id_dsa.myjavahost
  6. Now make sure permissions are correct on the key (one-time task) and connect:
    mypc:~$ chmod 600 .ssh/id_dsa
    mypc:~$ ssh -p1033 -i .ssh/id_dsa yourusername@yourservername
    Enter passphrase for key '.ssh/id_dsa':
  1. Provide the password for the key, set up in step #2

You should be logged in by now.

Fix “Can’t Upgrade Due to Low Disk Space on /boot” in Linux

Learn how to resolve the ‘low disk space on /boot’ error during Linux upgrades. Follow step-by-step solutions to free up /boot and complete your system updates.

Your /boot partition is filled with old kernels. It does that sometimes, not sure why it is never fixed. You can easily remove the old kernels if you know which packages they came in.

First check uname -a to check your current version.

Then run the following command:

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'

This command will list all packages that you no longer need. I don’t like removing them automatically, I like to be in control when it comes to removing kernels. So for every package listed do the following:

sudo apt-get -y purge some-kernel-package

Intermezzo

This intermezzo describes in more detail how the commands work and tries to fix an issue with linux-libc-dev:amd64. Most users can skip this paragraph.

  • dpkg -l 'linux-*' list all packages that have a name starting with ‘linux-‘
  • sed '/^ii/!d; remove all lines that do *not* start withii`
  • uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/" find the current running kernel version
  • /'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d Remove all lines, except the ones containing the current running kernel version number
  • s/^[^ ]* [^ ]* \([^ ]*\).*/\1/ For each line list only the package name
  • /[0-9]/!d Remove lines that do not contain numbers.

To fix Frederick Nord’s issue I think the command can be amended as follows:

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d;/^linux-\(headers\|image\)/!d'

It basically adds an extra filter:

  • /^linux-(headers\|image)/!d Delete all lines that do not start with linux-headers or linux-image

/Intermezzo

Where some-kernel-package can be replaced with one of the packages listed. Just beware that you don’t remove the kernel packages that are in current use (as listed by the uname -a) eg. sudo apt-get purge -y linux-headers-3.0.0-12 etc.

It can be automated further using the xargs command, but I don’t like that. It is a personal thing. However, here’s the command to do so:

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

This is what my /boot looks like, one spare kernel (2.6.38-11) just in case and 3.2.0-24 being current:

$ ls -l /boot
total 59388
-rw-r--r-- 1 root root   730545 Sep 13  2011 abi-2.6.38-11-generic
-rw-r--r-- 1 root root   791023 Apr 25 13:51 abi-3.2.0-24-generic
-rw-r--r-- 1 root root   130326 Sep 13  2011 config-2.6.38-11-generic
-rw-r--r-- 1 root root   140341 Apr 25 13:51 config-3.2.0-24-generic
drwxr-xr-x 3 root root     5120 May 27 17:46 grub
-rw-r--r-- 1 root root 20883146 Oct  1  2011 initrd.img-2.6.38-11-generic
-rw-r--r-- 1 root root 22474219 May  5 09:04 initrd.img-3.2.0-24-generic
drwxr-xr-x 2 root root    12288 Apr 16  2009 lost+found
-rw-r--r-- 1 root root   176764 Nov 27 11:00 memtest86+.bin
-rw-r--r-- 1 root root   178944 Nov 27 11:00 memtest86+_multiboot.bin
-rw------- 1 root root  2656297 Sep 13  2011 System.map-2.6.38-11-generic
-rw------- 1 root root  2884358 Apr 25 13:51 System.map-3.2.0-24-generic
-rw------- 1 root root     1369 Sep 13  2011 vmcoreinfo-2.6.38-11-generic
-rw------- 1 root root  4526784 Sep 13  2011 vmlinuz-2.6.38-11-generic
-rw------- 1 root root  4965776 Apr 25 13:51 vmlinuz-3.2.0-24-generic

And file system usage:

$ df -h /boot
Filesystem Size Used Avail Use% Mounted
/dev/sda5  228M  63M  154M  29% /boot

 

Compare Two MySQL Databases Using MySQL Workbench – Step-by-Step Guide

Learn how to compare two MySQL databases using MySQL Workbench. Identify schema differences, generate synchronization scripts, and keep your environments in sync.

When working on database-driven applications, it’s common to maintain multiple copies of a MySQL database — such as development, staging, and production. Over time, these environments may drift out of sync, making it essential to compare the database schemas to identify differences.

In this article, you’ll learn how to compare two MySQL databases using MySQL Workbench, and how to synchronize or export the differences between them.

Why Compare Databases?

Database comparison is especially useful for:

  • Identifying schema differences between environments
  • Detecting missing tables, columns, or indexes
  • Preparing migration scripts
  • Ensuring version control for database structures

Tools Required

To perform the comparison, you’ll need:

  • Connection credentials for both databases (source and target)
  • MySQL Workbench (preferably version 6.3 or later)

Steps to Compare Two MySQL Databases

Open MySQL Workbench

Launch the Workbench and make sure both databases (e.g., dev_db and prod_db) are accessible via configured connections.

Go to “Database” → “Compare Schemas”

From the top menu, go to:

Database → Compare Schemas

This opens a new window where you can choose the source and target schemas.

Select Source and Target Schemas

  • Source: Select the original or current version of your database (e.g., dev_db)
  • Target: Select the database you want to compare against (e.g., prod_db)
  • Click “Next” to proceed.

Start Comparison

MySQL Workbench will analyze both databases and show the results in terms of:

  • Tables only present in one database
  • Tables that exist in both but have structural differences
  • Differences in columns, indexes, constraints, routines, views, triggers, etc.

Review the Differences

You’ll be presented with a detailed comparison table showing:

  • Objects to add, modify, or drop
  • SQL scripts representing those changes

This is useful for developers and DBAs to audit what’s changed or to plan a synchronization.

Synchronize or Export Differences (Optional)

You can either:

  • Synchronize directly from source to target using MySQL Workbench
  • Or export the SQL script to apply changes manually after review

Warning: Always back up your databases before applying synchronization scripts to avoid accidental data loss.

Use Case Example

Let’s say you added a new table and modified a few column types in your development database. By using MySQL Workbench’s schema comparison, you can quickly identify those changes and generate a script to apply them to production without having to track each change manually.

Conclusion

MySQL Workbench provides a powerful built-in Schema Comparison Tool that helps you:

  • Identify differences between two MySQL databases
  • Review structural changes in tables, views, routines, and more
  • Generate SQL scripts to synchronize schemas safely

This feature is invaluable for teams managing multiple environments or collaborating on large database projects.

For more information about MySQL Workbench, visit http://www.mysql.com/products/workbench/
MySQL Workbench is freely available at http://www.mysql.com/downloads/workbench/.

Google Chrome Remote Desktop: Access your PC from anywhere

Learn how to securely access or allow remote access to your computer using Google Chrome Remote Desktop. Step-by-step guide for Windows, Mac, and Linux users.

Remote access tools are essential in today’s connected world — whether you’re offering tech support, working from home, or accessing files on the go. One of the most reliable and secure tools for this purpose is Chrome Remote Desktop by Google.

What is Chrome Remote Desktop?

Chrome Remote Desktop allows users to remotely access another computer through the Google Chrome browser or a Chromebook. It supports both short-term access (e.g., for remote support) and long-term remote access (for accessing files and apps on your own machine).

All connections are fully encrypted and secure.

How to Set It Up

Requirements:

  • A Google account
  • Google Chrome browser
  • Chrome Remote Desktop extension

Setup Remote Access:

  1. On your computer, open Chrome. (Login to chrome with your Gmail account)
  2. In the address bar, enter remotedesktop.google.com/access. It will open the remote desktop setup window.
  3. Under “Remote Access,” click Download Download page.
  4. Follow the onscreen directions to download and install Chrome Remote Desktop.

You may have to enter your computer password to give Chrome Remote Desktop access. You may also be prompted to change security settings in Preferences.

Share Your Computer

Now, you can provide your computer full access to others. They’ll have full access to your apps, files, emails, documents, and history.

  1. On your computer, open Chrome.
  2. In the address bar at the top, enter remotedesktop.google.com/support, and press Enter. or enter remotedesktop.google.com/access and select “Remote Support”,
  3. Under “Remote Support, “ click Download Download page.
  4. Follow the onscreen directions to download and install Chrome Remote Desktop.
  5. Under “Remote Support,” select Generate Code.
  6. Copy the code and send to the person you want to have access to your computer.
  7. When that person enters your access code on the site, you’ll see a dialog with their email address. Select Share to allow them full access to your computer.
  8. To end a sharing session, click Stop Sharing.

Tip: Once setup is complete, you don’t need to keep the Chrome browser open. Your PC just needs to be turned on and connected to the internet.

Features

  • Fully secure and encrypted connections
  • Cross-platform support: Windows, macOS, Linux
  • Access from any device with a Chrome browser
  • Completely free to use

Important Notes

  • Your computer must remain powered on and awake to accept remote connections.
  • Chrome Remote Desktop is not tied to the Chrome browser once access is configured.
  • Make sure to never share your access code with untrusted users.

Privacy & Support

FAQs

Q: Is Chrome Remote Desktop safe?
Yes, it uses secure SSL connections and requires authentication and access codes.

Q: Can I use it on my mobile device?
Yes! Install the Chrome Remote Desktop app on Android or iOS to access your computer remotely.

Q: Do both devices need to be online?
Yes, both devices must be connected to the internet.

Final Thoughts

If you’re looking for a simple, secure, and free way to access your devices or help someone with theirs, Chrome Remote Desktop is one of the best tools available today.