|
Are you tired of trying to remember loads of passwords? I don't even attempt to remember my passwords there are so many of them. Since the computer is the thing that always wants the passwords, I like to keep them on the computer itself, where they are easy to access whenever needed. I have a well hidden text file that has all of my passwords in it, and I have written a script that extracts a single password from the file based on it's account name, and loads that password to the clip board buffer for pasting into password dialogs. The script takes one command line parameter, the name of the account you want the password for. You can call it from a Linux GUI's menu item entry, and make that menu item's name, and description something that disguises it from it's real purpose. If someone were to run the menu item to see what it does, they would find that it does nothing apparently, since all it does is load the password into the clipboard. This script depends on the package xclip being installed on your system, so be sure xclip is installed before you attempt to run it, by using the command "sudo apt-get install xclip" in Terminal. In the following code box is the source code for the password loading script. Copy, and paste it into a new file in your editor, then make any changes that you want to personalize it to your system as suggested below the code box. #!/usr/bin/env bash # Usage: LoadClip.sh "account name" # # LoadClip.sh version 1.05 # make sure to use quote marks if the account name is more than one word, # so all words get passed in as one parameter. ## Copyright: ## Copyright 2009 by C. Ray Parrish You may want to change the last line in the script to reflect a different file path, and file name than the very obviously named ones I use in this example. The password record file can be placed anywhere on your system as long as you change this last line in the script to reflect it's location, and name. After you save the LoadClip.sh file, make sure you set the execute permission for your user on the saved file so it can be ran. You can save the script to any convenient location on your file system. The password record file is structured so that each line has one piece of information. The first line will be an account name, the next line will be that account's password, and you can optionally add a third line with the user name for that account. For more than one account, simply repeat the pattern with each account in turn down through the file. When you call the script make sure that the account name you pass in exactly matches the account name in the password record file. Here is a sample password record file with three accounts set up in it. Ubuntu gpwpjt-26752hww] ray Face Book gjr2-05946bms;mew]g=05uy rayparrish Twitter j2g-8t2-5ubwjj; rayparrish With this script you no longer have to even know your passwords, the computer will remember them for you, as long as you can remember which disguised menu item goes with which account name. After loading the password to the copy buffer, this script will wait 120 seconds, then write a space character to the clip board to clear the used password. This is just a small security measure to prevent you from accidentally pasting your passwords into something at an inappropriate time. You may change the length of the timeout before the clipboard is cleared by modifying the "sleep" command on line 16 of the script. I've tested the script in Ubuntu Linux, and I hope it works in other distributions as well. If it does not, let me know by email. Note that in most password dialogs in Ubuntu you will have to use CTRL-V to paste the password in. In Terminal in Ubuntu, you need to use Edit, Paste from the Terminal menu to paste a password in that was loaded by this script as CTRL-V will not work there. After I do some studying, and research I will be modifying the script to read passwords from an encrypted version of them in the text file, and will be writing a companion script to encrypt new passwords, and add them to the password record file for you. UPDATE: I discovered that the script was adding a new line character at the end of my passwords when it loaded them to the clipboard, so this newest version has that problem fixed by the use of \c in the echo statement to suppress newlines. Now my passwords work again at the bank, and Pay Pal. I hereby release LoadClip.sh as open source software for Linux computers. Help me keep writing code for others to use. Please consider making a donation of whatever you can afford if you use my scripts, even something as small as one dime would help a lot. Thanks. |