Generate ssh keys on linux and use with PuTTY on Windows

Log into the Linux server as the user you are going to use to connect with ssh. Generate the key.

ssh-keygen -t rsa -b 4096 -C "email@domain.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:3/dDa9R+zzDpGNt/EU9Jusj/snbKt3+B8F+ULnxXtWk email@domain.com
The key's randomart image is:
+---[RSA 4096]----+
|                 |
|               ..|
|              o *|
|           . . E+|
|        S . = =o=|
|         . + * O=|
|          . + @.*|
|            .@ %=|
|            ++@+#|
+----[SHA256]-----+

Now copy the id_rsa key to your Windows desktop. This can be done by copying and pasting the contents of the file or using an SCP client such as PSCP which is supplied with the PuTTY install or FileZilla.

Read more

Replace PHP 5.4 with 5.6 in CentOS 7.x

How to replace php 5.4 with php 5.6. Before installing PHP 5.6, apply any existing updates available for your distribution: # yum check-update # yum update Also, this is a good moment to get (and save somewhere) a list of our installed packages (in case we need to rollback): # rpm -qa |grep php php-mbstring-5.4.16-36.1.el7_2.1.x86_64 … Read more

Stress Test CentOS with Stress

First, you need to download the file using Wget and then install it using RPM on your system to enable the EPEL repository. RHEL/CentOS 7 64 Bit # wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm # rpm -ivh epel-release-latest-7.noarch.rpm ## RHEL/CentOS 6 64-Bit ## # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm # rpm -ivh epel-release-6-8.noarch.rpm Check the installation # yum repolist *epel/x86_64 Extra Packages … Read more

Check if a Package is Installed

One of the most common requests and inquirys is “Do I have the …xyz package or program installed?” Here is how to check. Ubuntu/Debian List all packages # dpkg -l | less # dpkg -s apache-perl To check whether a package is installed or not: dpkg -l | grep vlc Use file /var/lib/dpkg/available to find … Read more

See IP’s Accessing Website

Here is a way to see what IP’s are accessing the website domain.com. Find the location of the access logs. In a cpanel account: # cd /home/domain.com/access-logs Now run the following on the access logs… # cat domain.com | awk '{print $1}' | sort | uniq -c | sort -rn | head Here is the … Read more