RE: ssh-agent and ssh-add automatically

From: Wilson, Richard E (
Date: 12/17/02

  • Next message: Woodson, Michael A.: "RE: Replacing non-interactive ftp connections with sftp?"
    From: "Wilson, Richard E" <>
    To: "'David Danovich'" <>,
    Date: Tue, 17 Dec 2002 14:59:21 -0600


    You can get away with doing this once every time the system boots, but it
    still has to be done. Here's how (also using RH 7.3):

    ssh-agent | head -2 > $HOME/.ssh-agent.dat

    Then add the following to your .bashrc (assuming you're using bash):

    if [ -f $HOME/.ssh-agent.dat ]; then
      . $HOME/.ssh-agent.dat

    You can of course create a system startup script to handle this, but it will
    have to have the individual ID's pass phrases available to it somehow and
    has to run as the ID that will be using the agent. Has anyone out there
    created a secure solution to that one?

    Richard Wilson

    -----Original Message-----
    From: David Danovich []
    Sent: Tuesday, December 17, 2002 2:49 AM
    Subject: ssh-agent and ssh-add automatically


    I have a linux cluster (RedHat 7.3) with 4 linux boxes. In order for ssh to
    operate without password I seted up private authentication keys using
    ssh-keygen -t rsa command. Created authorized_keys and known_hosts files and
    everything works fine. The problem is that every time I open a new window or
    start a new session I have to carry out several commands in order to use
    this ssh without password. The commands I need to do is following

     ssh-agent $SHELL

    I also need to write my passphrase and only after this procedure I am able
    do carry out any command on any nodes directly from server without typing
    password or passphrase. (For example, command like ssh -n har3 date). Har3
    is the name of one of the node.

    What I want is to skip this procedure with ssh-agent and ssh-add commands.
    Is it possible to modify some configuration files of ssh so that I would be
    able to carry out command on nodes when I write it actually on server (like
    above command ssh -n har3 date) directly when I start a new session without
    ssh-agent and ssh-add commands.

    Thank you in advance David

    Relevant Pages

    • Re: Starting ssh-add
      ... What I'm trying to do, is run ssh between computers on my home lan, without ... before using the ssh command. ... A couple of things I've noticed, is that ssh-add ... Autostart directory, it doesn't seem to work in .profile, even though other ...
    • emulating an ANSI terminal ?
      ... I'd like to emulate an ANSI terminal from Rubyusing ssh. ... I've found some kind of workaround executing another command, ... I'd like to authentify using ssh-add from UI. ...
    • Re: ssh-agent, keychain, xsession bash_profile scripting
      ... "Could not open a connection to your authentication agent." ... from ssh-add, and nothing but inaction from keychain. ... I always boot into a command line and then run startx when I need it, ... shell you want to have access to your keys ...
    • Re: ssh connection without passwd
      ... the display to thin Client, Where I installed DSL, because the disk ( ... just a flas) is small and can't support a big distro. ... I tried the command like on server for example: ... but the ssh-add gave cannot open a connection to ...
    • ssh-agent and ssh-add automatically
      ... ssh-keygen -t rsa command. ... order to use this ssh without password. ... Har3 is the name of one of the node. ... What I want is to skip this procedure with ssh-agent and ssh-add ...