Recipe 17.9. Shutting Down ssh-agent Automatically at Logout

 < Day Day Up > 

17.9.1 Problem

As a security measure, you would like to ensure that any stray ssh-agent processes are killed automatically when you log out.

17.9.2 Solution

Make this entry in your ~/.bash_logout file:

kill $SSH_AGENT_PID

17.9.3 Discussion

Don't do this if you're using keychain, because the whole point of using keychain is to be able to log in and out without having to re-enter your passphrases.

If you don't have a ~/.bash_logout file, create one. There should be a system-wide default logout file at /etc/skel/.bash_logout to use as a model.

17.9.4 See Also

  • bash(1), ssh-agent(1)

  • SSH, The Secure Shell: The Definitive Guide

     < Day Day Up > 


    Linux Cookbook
    Linux Cookbook
    ISBN: 0596006403
    EAN: 2147483647
    Year: 2004
    Pages: 434

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net