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 архів файлів, які ви хочете забезпечити, а потім додати шифрування паролем до нього.























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