Have you ever wondered that you can password protect a file in Linux using through VIM ? Ye’s it’s correct and it’s quite simple too.
To password protect a file in Linux use the command below.
root@justgeek~]# vim +X justgeek.txt
+X option will make password protect your file.
root@justgeek~]# vim +X justgeek.txt "justgeek.txt" [New File] Enter encryption key: Enter same key again: Now write anything you want and save it using !wq "justgeek.txt" [New][crypted] 0L, 0C written root@justgeek~]#
That’s it !! Enjoy Securing