Generate a password for website authentication that can be recreated each time you need to authenticate without saving the password

echo http://www.TheWebSiteName.com privatekeyword | md5sum | awk '{print substr($0,0,10)}'
Create a bash function for easy reference webPassword() { echo $1 $2 | md5sum | awk '{print substr($0,0,10)}' } alias webpwd=webPassword Use like this. webpwd www.commandlinefu.com MyPetNameHere
Sample Output
$ echo http://www.TheWebSiteName.com privatekeyword | md5sum | awk '{print substr($0,0,10)}'

3ac2dd2389

0
By: ertjies
2012-06-28 11:32:08

These Might Interest You

  • Enter your ssh public key in the remote end for future key-based authentication. Just type your password one last time. The next time you should be able to login with the public key. If you don't have a key, generate one with ssh-keygen. Requires Bourne-compatible shell in the remote end.


    5
    cat .ssh/id_dsa.pub | ssh elsewhere "[ -d .ssh ] || mkdir .ssh ; cat >> .ssh/authorized_keys"
    jsiren · 2009-02-18 22:13:04 2
  • Useful for testing domain authentication through a Linux server Show Sample Output


    0
    wbinfo -a username%password
    shawn_abdushakur · 2013-10-01 12:54:08 0
  • I have a server with a php requiring basic authentication, like this: header('WWW-Authenticate: Basic realm="do auth"'); header('HTTP/1.0 401 Unauthorized'); ...?> And the basic authentication in wget do not worked: wget --auth-no-challenge --http-user="username" --http-password="password" -O- "http://url" wget --keep-session-cookies --save-cookies=cookies.txt --load-cookies=cokies.txt --http-user="username" --http-password="password" -O- "http://url" I always received the 401 Authorization failed. The saved cookie is always empty. With my way, I received the header from the server and save the cookie, then resend the session cookie with authentication data Show Sample Output


    1
    wget --auth-no-challenge --server-response -O- $url 2>&1 | grep "Cookie" | sed "s/^ Set-//g" > cookie.txt; wget --auth-no-challenge --server-response --http-user="user" --http-password="pw" --header="$(cat cookie.txt)" -O- $url
    glaudiston · 2010-12-01 11:24:35 0
  • ZenCart uses a MD5 with a salt to secure its passwords. If you need to forcibly change someone's password to a known value within the database, this one-liner can generate the password. Change the value of 'p' to the password you want. Show Sample Output


    1
    python -c 'p="SeCuR3PwD";import hashlib as h;s=h.md5(p).hexdigest()[:2];pw=h.md5(s+p).hexdigest();print pw+":"+s;'
    Xiol · 2011-10-16 18:49:08 1

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: