Skip to content Перейти до змісту


How to password protect files in Linux Як захистити паролем файли в Linux

LinuxБезпека

If you store important information on your Linux server and want to make sure it is for your eyes only you need to password protect these files. Якщо ви зберігаєте важливу інформацію про ваш сервер Linux і хочете переконатися, що вона для ваших очей потрібно захистити паролем цих файлів. Let's see how you can do this with Linux. Давайте подивимося, як це можна зробити з Linux.

First, pick a good password. По-перше, вибрати гарний пароль. There are a few websites on the Internet that help you generate strong passwords. Є кілька веб-сайтів в Інтернеті, що допоможе вам Генератор паролів. Try and pick an alphanumeric password. Спробуйте підібрати буквено-цифровий пароль. Something such as Rv7fkcxASW8h would be a good choice. Что-то таких, як Rv7fkcxASW8h буде гарним вибором.

Now check to see if you have the package gpg installed on your computer. Зараз перевіримо, якщо у вас є пакет GPG, встановлених на вашому комп'ютері. Run the following command to check: Виконайте наступну команду, щоб перевірити:

# whereis gpg # WhereIs GPG
gpg: /usr/bin/gpg /usr/share/man/man1/gpg.1.gz GPG: / USR / BIN / GPG / usr/share/man/man1/gpg.1.gz

If you get an output like the one shown above it means you have the required package installed. Якщо ви отримали вихідний, як показано вище це значить, у вас є необхідний пакет. If not, check your Linux distribution's documentation to see how you can install the GPG package. Якщо ні, перевірте документацію до дистрибутива Linux, щоб побачити, як ви можете встановити пакет GPG.

Say you want to password protect a file called dbbackup.zip with the password Rv7fkcxASW8h here's how you would go about it: Припустимо, ви хочете захистити паролем файл dbbackup.zip з паролем Rv7fkcxASW8h ось як піде про нього:

# gpg -c dbbackup.zip # GPG-C dbbackup.zip

When you enter this you will be requested to enter a passphrase, which is the password you want to protect the file with. При введенні цього вам буде запропоновано ввести пароль що є пароль, які ви хочете захистити файл з розширенням. Enter the password twice. Введіть пароль двічі. Now you should see a file called dbbackup.zip.gpg in the same directory as the original file. Тепер ви повинні побачити файл з ім'ям dbbackup.zip.gpg в тому ж каталозі, що і вихідний файл. This is the encrypted and password protected copy of the original file. Це зашифровані і захищені паролем, копію оригінального файлу. You can store this file on your hard drive or ship it to someone on a DVD knowing that it will be very hard and nearly impossible for most people to crack it. Ви можете зберегти цей файл на жорсткому диску або відправити її хтось на DVD, знаючи, що це буде дуже складно і практично неможливо для більшості людей це тріщина.

When you want to read the file you will need to remove the password protected encryption. Якщо ви хочете прочитати файл, який ви повинні будете видалити пароль шифрування. For that execute the following command: Для цього виконайте такі команди:

gpg dbbackup.zip.gpg GPG dbbackup.zip.gpg

You will be asked to enter the password using which the file was protected. Вам буде запропоновано ввести пароль, використовуючи який захищає файл. Enter that and you should be in business. Введіть, що і ви повинні бути в бізнесі. Note that this only works for files and not for folders. Зауважимо, що це працює тільки для файлів, а не для папок. You should create a zip or tar archive of the files you want to secure and then add the password protected encryption to it. Ви повинні створити поштовий індекс або TAR архів файлів, які ви хочете забезпечити, а потім додати шифрування паролем до нього.

Posted in Опубліковано в Linux Linux , , Security Безпека . .

Get Simple Help tutorials just like this one in your email inbox every day - for free! Отримати довідки Прості підручників, як це у вашому поштовому ящику щодня - безкоштовно! Just enter your email address below: Просто введіть свою адресу електронної пошти нижче:

You can always opt out of this email subscription at any time. Ви завжди можете відмовитися від підписки це повідомлення в будь-який час.

3 Responses 3 Відповіді

Stay in touch with the conversation, subscribe to the Залишайтеся на зв'язку при розмові, підпишіться на RSS feed for comments on this post RSS-канал для коментарів на цю посаду . .

  1. IT Buzz ІТ-Buzz says говорить

    Thanks a lot i was looking for this command from last week. Велике спасибі Я шукав цю команду з минулого тижня. Ultimately find it at your website. У кінцевому підсумку знайти її на вашому сайті.

Continuing the Discussion Продовжуючи розмову

  1. | Standalone Sysadmin | Автономні Sysadmin linked to this post on June 29, 2009 пов'язані на цю посаду 29 червня 2009

    [...] to ssh authentication. [...] Для SSH аутентифікації. If you want to learn more about how to use it, Simple Help has a tutorial on it, covering the very basic usage. Якщо ви хочете дізнатися більше про те, як його використовувати, Прості довідки має підручника по ньому, що охоплює самі основні використання. Once you're comfortable with that, check out the [...] Коли Вас влаштовує, що перевірити [...]

  2. Password-protect files in Linux « Linux & Stuff Захищені паролем файли в Linux «Linux & Stuff linked to this post on July 1, 2009 пов'язані на цю посаду 1 липня 2009

    [...] in CLI, password | Tags: CLI, password Here's a useful CLI to enable protecting special files in your system. [...] У CLI, пароль | Мітки: CLI, пароль Ось корисний CLI, щоб захистити файли у вашій системі. To protect file.txt just run [...] Щоб захистити file.txt просто запустіть [...]



Some HTML is OK Деякі HTML нормально

or, reply to this post via або відповісти на цей пост через trackback Архів . .