lftp Fatal error: Certificate verification: Not trusted

When i connect to an FTP server, i get following error

[email protected]:~# lftp -u sokftp 54.37.215.1
Password:
lftp [email protected]:~> dir
ls: Fatal error: Certificate verification: Not trusted
lftp [email protected]:~> ls -la
ls: ls -la: Fatal error: Certificate verification: Not trusted
lftp [email protected]:~>

To fix this, run

You can add this to /etc/lftp.conf to make this permanant

Add

See lftp

Create New Hosting Account in WHM

To create new hosting account in Cpanel/WHM, login to WHM at

http://yourserverip/whm

Now to go

You can also use the search box on left top side of WHM. Search for “create”, then click on “Create a New Account” link.

On “Create a New Account” page, you need to enter your domain name. User name will be auto generated. Click “Password Generator” to generate secure password. Make sure you copy this password as you need it later for login to Cpanel/FTP.

Scroll down and click “Create button”.

Now your hosting account is ready.

You will be able to login to Cpanel at

http;//yoru-server-ip/cpanel

Change PHP version

To change PHP version for a web site, login to cpanel at

http;//yoru-server-ip/cpanel

Once logged in search “php”

Click on “MultiPHP Manager” button. On next page, you will be able to change PHP version for the web site.

On this page, click the checkbox right side of your domain name. From “PHP Version” drop down, select the PHP version you need. Click Apply. Now your site have selected PHP version.

SSH Remember Passphrase

When i connect to remote server using SSH using private key, it ask for passphrase every time.

I want it only ask once, then remember it.

To do this, you need to run

When you run “ssh-add” command, it ask for your passphrase. Now you will be able to use your SSH Key with out getting promoted for passphrase.

I added the commands in .bashrc in one of the server i used to connect to other servers, now when ever i login, it ask for my SSH passphrase.

See ssh

Ubuntu Slow Boot

Last day my PC become very slow to boot.

It take 3 minutes and 17 seconds to boot up.

This happend after i did some changes to my 2nd hard disk and added ZFS partition. First thing i thought it was ZFS that make my PC slow.

systemd-analyze blame did not show any useful info.

systemd analyze blame

To find the problem, i edited the file

Find the line

Replace it with

Now rebuild grub.cfg with

Rebooted the PC. Now instead of showing Ubuntu splash screen, you get lot of text, that shows what actually your PC is doing.

Ubuntu Grub Disable Splash

From the boot message i found system waiting 1 minutes 30 seconds for mounting one of the disk partition. This is because i re-partitioned my 2nd hard disk and forget to remove the disk from /etc/fstab.

I removed the non existant disk entry from /etc/fstab and rebooted PC. Now it boot much faster.

systemd analyze

See Ubuntu

Configure Networking in Fedora 28 OVH Proxmox

OVH have special networking requirement. First you need to login OVH and create vMAC for your IP address. Now create VM in Proxmox, during VM creation, specify this vMAC address under Network > MAC.

Proxmox create virtual machine

Once your VM is installed, you don’t have network access. Login to the server using Proxmox Console.

Run following commands

Replace following in above commands

FAILOVER_IP = IP address of your Virtual Machine.

GATEWAY_IP = This is gateway IP addres. This is IP address of your host machine (the server on which proxmox installed). Replace last digit with 254. For example, if your servers main IP is 123.123.123.142, then use 123.123.123.254 as gateway.

Here is an example

At this point, you will be able to login to server using SSH. You may not able to ping outside, for this, you need to edit /etc/resolv.conf and add nameserver entry.

Add

To make it permanant, edit

Find

Replace with

Example

For routung, create

Example

Setup ZFS file system in Ubuntu

ZFS file system allow you to take snapshot, this is great for backing up MySQL databases. Last day i setup 2 * 2 TB Hard disk on My PC as RAID 1 (mirror) using ZFS.

First install ZFS with

I created same size partition on both hard disks. You can use full disk if you want, but i created partition, so i can use first 100 GB of each disk for installing Operating system.

RAID 1

RAID 1 mirror data between 2 disks. Even if one of the disk die, your data will be safe.

To create RAID 1, run

Here sdx3 and sdy3 is partition on my HDD. Replace it with your actual partition to be used with ZFS. Be carefull not to use wrong partition or you will lose data.

If you are using full disk, then use

RAID 0

RAID 0 is dangerous, only use if you don’t care about data or you have a backup. If one of the disk fails, you will lose all data.

To setup RAID 0, use

Pool

Once you create a ZFS pool with “zpool” command, it get auto mounted as “/pool-name”. In above cause, i used name “tank”.

Here is what i have on my PC

The 2nd entry is the ZFS pool tank.

Datasets

Datasets are like partitions. You can create multiple partitions inside your pool, they sare disk space. You can set disk quotas if needed, by default no quota per datasets are set.

In above example /tank/data is a datasets i use.

To create a data set, run

Here “-o mountpoint” specify where you want to mount the new dataset.

zpool status

To see status for your ZFS file system, run

See zfs

Add ISO Images to Proxmox

proxmox

To add ISO images to proxmox server, login to server as user root, then go to folder “/var/lib/vz/template/iso”. You can download ISO for operating system you need to this folder.

For Debian 9

For Fedora 28

See proxmox

Downloading Proxmox CT Templates

Proxmox allow you to create fully virtualized virtial machines and Linux Containers. Linux Containers have lightweight, share kernal used by host server.

Before you can create CT, you need to download templates.

To list all available CT images, run

Proxmox CT Templates

Download a template

To download a proxmox CT template, run

This will download and save template to folder “/var/lib/vz/template/cache/”

proxmox download template

List available templates

To get list of all templates available on your installation, run

proxmox pveam list local

See Proxmox

Nginx Proxy SSL Verification

When using Nginx as reverse proxy, you may need to handle SSL verification request. Passing this request to backend server may not do any good as back end servers normally only handle application.

To hanlde SSL validation request, use following Nginx Configuration

Create a folder for SSL validation files.

Now restart Nginx

You can get SSL with following letsencrypt command

See LetsEncrypt, Nginx

Nginx Config for rtmp streaming

Here is nginx config used for RTMP streaming.