VIM encryption function

Source: Internet
Author: User

-The advantages of VIM's encryption function

1. After encryption, if you do not know the password, you will not see the plaintext, including the root user can not see

-Cons

1. Obviously let others know encryption, it is easy for others to destroy the encrypted files, including content destruction and deletion;

-Encryption Test

```

[Email protected] shell]# vim Jiami.txt

Jaogj

Chy

Jaogaowe

Jaoghwq

Jaog

(The above content is only test content)

: X (note here is the uppercase X) carriage return;

Enter Password: ************ (enter after you can see the need for password)

Please enter again: ************

Then save and exit

[[email protected] shell]# cat Jiami.txt (after viewing is garbled

vimcrypt~01! O_. 4x¤:a

```

= = with cat or more to view the contents of the file, displayed as garbled, with Vim to re-edit the file, will prompt for a password, if the password entered is incorrect, the same will be displayed as garbled!

Note: Do not forget the password after the file is encrypted! ==

-If the password is set, but there is a problem we set the password how to cancel the password? Here's how vim cancels the password

1. First method:: Set key=

```

Johagowhoag

Jaogj

Chy

Jaogaowe

Jaoghwq

Jaog

: Set key=

Use VIM to open the file, such as Jiami.txt, to enter the correct password, and then at the time of editing, set the password to NULL, the command is: set key=

[email protected] shell]# cat Jiami.txt

Johagowhoag

Jaogj

Chy

Jaogaowe

Jaoghwq

Jaog

```

2.

```

Johagowhoag

Jaogj

Chy

Jaogaowe

Jaoghwq

Jaog

: X after the direct return, enter after the direct use of the password can be saved to exit

[email protected] shell]# cat Jiami.txt

Johagowhoag

Jaogj

Chy

Jaogaowe

Jaoghwq

Jaog

```

Warm hint: The configuration file encryption, the program again to call the encrypted file is not possible.


VIM encryption function

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.