Monthly Archives: August 2017

Encrypt/Decrypt File with Vim Editor

In this howto we will see how to encrypt and decrypt a file with Vim editor.

Lets Encrypt a file:

linux-06ac:/opt # vim -x encryptedfile.txt
Warning: Using a weak encryption method; see :help 'cm'
Press ENTER or type command to continue

Now Press enter and it will ask you to set a password.

Enter encryption key: **********
Enter same key again: **********

Once you setup the password, you will be presented with the blank page where  you can start writing to the file as you do with Vim.

I am writing ” Helo Linux World” as an example to my encryptedfile.txt , save and quit with :wq

Not cat the file

linux-06ac:/opt # cat encryptedfile.txt 
VimCrypt~01!q"[�HY�&!���+B]3linux-06ac:/opt #

We can see that the file is Encrypted.

 

Decrypt the File:

To Decrypt permanently, open the file as following:

linux-06ac:/opt # vim encryptedfile.txt

Give the password to the file , you set while encrypting it.

Then type :X and press enter twice (without typing anything) when asked for “Enter encryption key:”

Now save and exit with :wq and viola the file is decrypted.

linux-06ac:/opt # cat encryptedfile.txt 
Helo Linux World

Thanks & Regards,

Salman A. Francis

YouTube: YouTube.com/Linuxking
Twitter: linuxking77
Facebook: https://www.facebook.com/groups/LZHProject/

HowTo Mount 8TB USB in CentoS 7 Server.

This howto is about “How To mount 8TB External USB” in CentOs 7 server.

# yum – y install epel-release

# yum -y install ntfs-3g

# lsblk

sdc 8:32 0 7.3T 0 disk
└─sdc1 8:33 0 7.3T

# mount -t ntfs /dev/sdc1 /mnt/

# ls -ltr /mnt

You will see it’s mounted.

Thanks,

Salman A. Francis

YouTube: LinuxKing

Facebook: Linuxking77 – LZHProject