Password protection script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Marin
    New Member
    • Jul 2021
    • 1

    Password protection script

    Is there any script for protecting a file in Arch Linux? I have important files that I want to, if you open them you must put a password to see the file.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Try reading this https://www.tecmint.com/file-and-dis...ols-for-linux/

    Probably one of your simplest options is to use a tool like 7-Zip to compress the file using encryption and a password. You would then need the password to decrypt the file. That is mentioned on that website. It does ratehr depend on the level of encryption and security you need. And the file type Open Document files can be saved with a password.

    Comment

    • SioSio
      Contributor
      • Dec 2019
      • 272

      #3
      If the target is a text file, use the vi command to edit the file with the -x option.
      Code:
      vi -x [file name]

      Comment

      • orkann
        New Member
        • Aug 2021
        • 1

        #4
        I think that file compression and password as say Banfa is OK

        Comment

        • cetpainfotech
          New Member
          • Jan 2023
          • 15

          #5
          There are several ways to create a password protection script for Linux. One common method is to use the "passwd" command in a shell script. This command can be used to change the password for a user account.

          Here is an example of a simple password protection script:

          #!/bin/bash
          echo "Enter the username:"
          read username
          echo "Enter the new password:"
          read -s password
          echo $password | passwd --stdin $username

          This script prompts the user to enter a username and a new password, and then uses the "passwd" command to change the password for the specified user.

          You can also use other tools like python,bash-scripting,Perl, Java to create a password protection script.

          You might also want to consider using a tool such as PAM (Pluggable Authentication Modules) to authenticate users. PAM allows you to use a variety of authentication methods, such as password, SSH keys, or biometrics, and it can be easily configured to work with various types of applications and services.

          Comment

          Working...