Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If you're using an extension or emacs mode (e.g. rcirc) that has auto-login or similar config to store username and password, how do you hide password and/or username info?

I'd like to do something similar to how you put a link to something like a .smbpasswd file in /etc/fstab.

share|improve this question
up vote 5 down vote accepted

The standard Emacs way is to put in .authinfo.gpg

machine login itsme password secret

and to encode it using gpg. I didn't test it with rcirc, but both gnus and tramp use it.

You can also put the same information into .authinfo, using only chmod to protect-it, but it won't be as secure.

Reading the source of Emacs auth-source.el show that it can do quite complex thing, in particular, you could use M-x customize-variable auth-sources to choose different way to specify login/mdp to Emacs (including gnome and kde stuff).

share|improve this answer
Out of curiosity: do these Emacs extensions require this file to be named .authinfo, or do they accept .netrc as well? Several other Unix tools use ~/.netrc, which has the exact same syntax. – grawity May 29 '12 at 7:41
@grawity: I do not know, but you can create a symbolic link nevertheless. – choroba May 29 '12 at 8:49
You can change the auth-sources Emacs variable to point to the file you use. Its default value is ("~/.authinfo" "~/.authinfo.gpg" "~/.netrc") meaning that .netrc will be looked at. – Rémi May 29 '12 at 15:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.