Ubuntu system encrypts files for transmission method

  

In today's increasingly prominent network security issues, how to ensure the security of Ubuntu system data in the transmission process? This article explains how to encrypt files in Ubuntu system. The Ubuntu file encryption transmission method and steps are as follows:

This article introduces Ubuntu Desktop 9.10 (i386) based on GNOME integrated desktop environment. And set up two computers with Host Ubuntu 9.10 desktop system Host1 and Host2, both installed OpenSSH software package and have the same user account (for the convenience of description, the same user name and password).

Getting Ready: Installing the Seahorse Key Manager Plugin

By default, the Ubuntu 9.10 GNOME integrated desktop environment software does not come with the Seahorse key manager plugin (seahorse-plugins), so In the Nautilus file browser, when a file is selected and the right mouse button is clicked, you can't see the "Encryption" and "Sign" & rdquo; two options in the pop-up shortcut menu, which can not be graphically The interface (which is integrated in the Nautilus file browser) to encrypt or sign files.

To do this, we can manually install the plugin using the “apt-get” command or “Synaptic Package Manager”. Here is an example of using the command line to install. Click on the menu "Applications & Rarr; Attachments & Rarr; Terminal", open the GNOME terminal window and enter the following command: "sudo apt-get install seahorse-plugins", after the command is executed, you can download and install <;seahorse-plugins&rdquo ; package. After the installation is complete, log out from the current system and log back in, you can see "Encryption" and "Sign" & rdquo; in the shortcut menu described above (as shown in Figure 1).



To encrypt a file or signed, first create the corresponding user's key. The created key is a pair and is divided into a public key and a private key. The public key is usually published and the file is encrypted by other users. After receiving the encrypted file from other users, use your private key to decrypt it.


Step 1. Create a local user key in Host1

Click on the menu <;Applications & Rarr; Attachments & Rarr; Passwords and Encryption Keys> Running Seahorse Key management program. In the “Password and Encryption Key” window that appears, click on the menu “File → New” and the “New” dialog box will appear. Because we want to encrypt the file, according to the description, choose the type of key created as “PGP Key” and click the “Continue” button to enter the “New PGP Key” dialog box. When creating a key, you need to specify the user's personal information, such as user name, email, etc., as well as the specified encryption type and key privacy strength (as shown in Figure 2). Once you have completed, click the “Create” button and enter your key protection password to create a user key.

Step two, to distribute a public key Host2 user

First, Seahorse Key Manager Export public key you just created. Click “File & Rarger; Export" in the "Keys and Encrypted Password" window, export the public key and click the “Save” button to generate the public key in the current login user (testuser) directory. File “testuser.asc”. Next, we pass the public key file to the Host2 host (here using the “scp” command as an example).

Open a GNOME terminal window on Host1 and enter the command “scp testuser.Asc testuser@Host2:~/.”. After the implementation, first enter “ld”;y” to join the host Host2 to the list of trusted hosts. Then enter the password of the user “testuser” on Host2, and then copy the “testuser.asc” file on Host1 to the testuser user directory of Host2 host (/home/testuser). After receiving the key file, the user on Host2 clicks on the “Key & Encrypted Password” window in the Seahorse Key Manager and clicks “File → Import” to find the file in the current login user directory. Testuser.asc” and open it to complete the import.

Step 3: Host2 user encrypts the file to be sent

With the public key of Host1 user, it can be used to encrypt the file on Host2. In the Nautilus file browser, right-click on the file to be encrypted, and select the “Encrypt” item in the shortcut menu that pops up, and the “Select Recipient” dialog box will pop up (as shown in Figure 3). In the key list, the available keys in the current system will be automatically listed, the public key of the Host1 user just imported will be selected, and the box in front of it will be checked. Click the “OK" button to start the file. Encrypt and generate an affiliation file (such as “abc.pgp”) at the end of the file name.

Similarly, using the & ldquo; scp & rdquo; command to transfer the encrypted documents to the Host1 & ldquo; scp abc.pgp testuser @ Host1: ~ /.& rdquo ;.

Step 4: Host1 user decrypts the received file

After the user on Host1 receives the encrypted file from the Host2 user, right click on the file in the Nautilus file browser. In the shortcut menu that pops up, select “Use Decrypt File to open ”, after entering the key protection password as required, the program will decrypt the file using the user's private key, and generate the decrypted file in the current directory, that is, restore Come out of the Host2 user encrypted file.

There are a lot of remote file transfers that need to be done over the Internet. To ensure data security, encrypting data is a very practical application. After reading this article, I believe that everyone has a preliminary understanding of encryption and decryption operations in Ubuntu. In the future application process, you may wish to try it yourself to improve the security of data transmission.



Copyright © Windows knowledge All Rights Reserved