Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: is it possible to mass import passes? #339

Closed
slackhead opened this issue Dec 24, 2017 · 2 comments
Closed

Question: is it possible to mass import passes? #339

slackhead opened this issue Dec 24, 2017 · 2 comments

Comments

@slackhead
Copy link

@slackhead slackhead commented Dec 24, 2017

I have a python script an exported all my passwords from firefox. I would like to add them to pass, but doing it one by one and with a password prompt would be messy.

Is there way I can import them automatically? Even if I wrote a shell script to read my password file and add that way it would be acceptable.

What are my options?

@jounathaen
Copy link
Member

@jounathaen jounathaen commented Dec 25, 2017

At the moment, I don't have the time to give you an exact solution, but QtPass is basically a GUI for Pass, which is an command line Tool.
It should be rather easy to automatise this with a script.
Something like pass insert blah blubber.
You can use pass on the same repository as you use for QtPass.

@slackhead
Copy link
Author

@slackhead slackhead commented Dec 26, 2017

This is what I came up with, if it's of use to anyone else:

Add passwords into ~/.password-store
passes.txt is created using firefox_decrypt.py from:
https://github.com/Unode/firefox_decrypt/blob/master/firefox_decrypt.py

python firefox_decrypt.py [firefox profile] > passes.txt

(Enter master password if there is one.)

You will need to check the first line of passes.txt, and if it's
blank, delete it.

bash:
`
PFILE=passes.txt
WC=$(wc -l $PFILE | awk '{print $1}')

for entry in $(seq 0 4 $WC)
do
unset ENTRY
for index in seq 1 3
do
ENTRY="$ENTRY$(head -n $((index+entry)) $PFILE | tail -n 1)\n"
done

URL=$(echo -e $ENTRY | grep Website: | awk '{print $2}'
| sed -r 's,^http[s]?://,,')

US=$(echo -e $ENTRY | grep Username: | awk '{print $2}'
| sed -r "s,',,g")

PW=$(echo -e $ENTRY | grep Password: | awk '{print $2}'
| sed -r "s,',,g")

echo "Processing $URL"
(echo $PW; echo "user: $US") | pass insert -f -m $URL
done
`

Ugh github uses hashes for formatting even when using code tags...

@slackhead slackhead closed this Dec 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants