[Wylug-help] Backing up to remote host - using keychain for passwords

Smylers Smylers at stripey.com
Wed Mar 2 12:42:56 UTC 2011


Anne Wilson writes:

> I thought that everything necessary was in my .bash_profile, which now
> reads
> 
> eval `keychain --eval id_rsa 1E1C9C17 --agents ssh,gpg`
> # Start keychain and indicate private key(s)
> #/usr/bin/keychain ~/.ssh/id_rsa /.gnupg/secring.gpg
> # stop the annoying "agent PID" message
> source ~/.ssh-agent > /dev/null
> # sourcing bashrc is a good thing
> source ~/.bashrc
> 
> (BTW - can I force this to be read again after making a change, without 
> logging out?)

Yes. The clue is in the last line of your .bash_profile quoted above,
which loads your .bashrc, using the source command. It works from the
shell prompt too:

  $ source .bash_profile

Much less intuitively, the source command can be abbreviated to a single
full stop, so this does the same thing with less typing:

  $ . .bash_profile

Note that source simply runs the commands in the file; it doesn't
'unrun' any previous commands. That means adding or changing something
in .bash_profile then source-ing it usually does what you want, but
after deleting something generally won't (because the command will have
been run previously, and simply not running it won't reverse that!), so
in some cases logging out and back in again is still the simplest thing
to do.

Hope that helps on this small aside, and good luck with solving your
main problem.

Smylers
-- 
http://twitter.com/Smylers2



More information about the Wylug-help mailing list