.\"  -*- nroff -*-
.\"
.\" ssh-agent.1
.\"
.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
.\"
.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
.\"                    All rights reserved
.\"
.\" Created: Sat Apr 23 20:10:43 1995 ylo
.\"
.\" $Id: ssh-agent.1,v 1.1.1.3 1999/04/01 00:09:44 nathanw Exp $
.\" $Log: ssh-agent.1,v $
.\" Revision 1.1.1.3  1999/04/01 00:09:44  nathanw
.\" 1999/3/31 Athena snapshot
.\"
.\" Revision 1.1.1.3  1999/03/08 17:42:59  danw
.\" Import of ssh 1.2.26
.\"
.\" Revision 1.8  1998/07/08 00:40:26  kivinen
.\" 	Changed to do similar commercial #ifdef processing than other
.\" 	files.
.\"
.\" Revision 1.7  1998/01/02  06:21:20  kivinen
.\" 	Documented -k option. Renamed SSH_AUTHENCATION_SOCKET to
.\" 	SSH_AUTH_SOCK.
.\"
.\" Revision 1.6  1997/04/27 21:48:50  kivinen
.\" 	Added F-SECURE stuff.
.\"
.\" Revision 1.5  1997/03/25 05:42:01  kivinen
.\" 	Added comment about ALTSHELL from napo.
.\" 	Changed ylo's email to @ssh.fi.
.\"
.\" Revision 1.4  1997/03/19 17:38:20  kivinen
.\" 	Added documentation for -c and -s options.
.\"
.\" Revision 1.3  1996/11/24 08:26:35  kivinen
.\" 	Documented new usage of ssh-agent.
.\"
.\" Revision 1.2  1996/11/01 15:32:49  ttsalo
.\"       Updated the manpage
.\"
.\" Revision 1.1.1.1  1996/02/18 21:38:13  ylo
.\" 	Imported ssh-1.2.13.
.\"
.\" Revision 1.4  1995/08/31  09:22:32  ylo
.\" 	Minor cleanup.
.\"
.\" Revision 1.3  1995/08/29  22:30:57  ylo
.\" *** empty log message ***
.\"
.\" Revision 1.2  1995/07/13  01:36:44  ylo
.\" 	Removed "Last modified" header.
.\" 	Added cvs log.
.\"
.\" $Endlog$
.\"
.\"
.\"
.\"
.\" #ifndef F_SECURE_COMMERCIAL
.TH SSH-AGENT 1 "November 8, 1995" "SSH" "SSH"
.\" #endif F_SECURE_COMMERCIAL

.SH NAME
ssh-agent \- authentication agent

.SH SYNOPSIS
.LP
.B ssh-agent 
.I command

.B eval `ssh-agent
[\c
.BR \-k \c
]
[\c
.BR \-s \c
]
[\c
.BR \-c \c
]`

.SH DESCRIPTION 
.LP
.B Ssh-agent 
is a program to hold authentication private keys.  The
idea is that
.B ssh-agent
is started in the beginning of an X-session or a login session, and
all other windows or programs are started as children of the ssh-agent
program (the
.IR command
normally starts X or is the user shell).  Programs started under
the agent inherit a connection to the agent, and the agent is
automatically used for RSA authentication when logging to other
machines using
.B ssh.
.LP
If the ssh-agent is started without any arguments (no command) it will
fork and start agent as background process. The agent also prints
command that can be evaluated in sh or csh like shells, that will set
the
.B \s-1SSH_AUTH_SOCK\s0
and
.B \s-1SSH_AGENT_PID\s0
environment variables.
The
.B \s-1SSH_AGENT_PID\s0
environment variable can be used to kill agent away
when it is no longer needed (you logout from X-session etc). If no
options are given the ssh-agent uses SHELL environment variable the
detect what kind of shell you have (*csh or sh-style shell). The
.BI \-c
option will force csh-style shell, and
.BI \-s
option will force sh-style shell.
.LP
Note that in SysV variants (at least IRIX and Solaris)
the environment variable SHELL might not contain the
actual value of the shell executing the evaluation.
If ALTSHELL is set to YES in /etc/default/login, the SHELL
environment variable is set to the login shell of the user.
.LP
The
.BI \-k
option can be used to kill agent automatically. It kills the agent (it
uses the
.B \s-1SSH_AGENT_PID\s0
to find it) and prints shell commands to stdout that will unset the
.B \s-1SSH_AUTH_SOCKET\s0
and
.B \s-1SSH_AGENT_PID\s0
enviroment variables.
.LP
The agent initially does not have any private keys.  Keys are added
using
.B ssh-add.
When executed without arguments, 
.B ssh-add
adds the 
.I \&$HOME/\s+2.\s0ssh/identity
file.  If the identity has a passphrase, 
.B ssh-add
asks for the passphrase (using a small X11 application if running
under X11, or from the terminal if running without X).  It then sends
the identity to the agent.  Several identities can be stored in the
agent; the agent can automatically use any of these identities.
.B "Ssh-add \-l
displays the identities currently held by the agent.
.LP
The idea is that the agent is run in the user's local PC, laptop, or
terminal.  Authentication data need not be stored on any other
machine, and authentication passphrases never go over the network.
However, the connection to the agent is forwarded over
.B ssh
remote logins, and the user can thus use the privileges given by the
identities anywhere in the network in a secure way.
.LP
A connection to the agent is inherited by child programs.  A
unix-domain socket is created
(\fI/tmp/ssh-$USER/agent-socket-<pid>\fR), where the %d is the process
id of the listener (agent or sshd proxying the agent). The name of
this socket is stored in the
.B \s-1SSH_AUTH_SOCK\s0
environment variable.  The socket is made accessible only to the
current user.  This method is easily abused by root or another
instance of the same user. Older versions of ssh used inherited
file descriptors for contacting the agent and used the unix-domain
sockets in an incompatible way.
.LP
If the command is given as argument to ssh-agent the agent exits
automatically when the command given on the command line terminates.
The command is executed even if agent fails to start it's key-storing
and challenge-processing services.

.SH FILES
.TP
.I \&$HOME/\s+2.\s0ssh/identity
Contains the RSA authentication identity of the user.  This file
should not be readable by anyone but the user.  It is possible to
specify a passphrase when generating the key; that passphrase will be
used to encrypt the private part of this file.  This file
is not used by
.B ssh-agent,
but is normally added to the agent using
.B ssh-add
at login time.
.TP
.I \&/tmp/ssh-$USER/agent-socket-<pid>
Unix-domain sockets used to contain the connection to the
authentication agent.  These sockets should only be readable by the
owner.  The sockets should get automatically removed when the agent
exits. The parent directory of ssh-$USER must have it's sticky bit
set.

.SH AUTHOR
.LP
Tatu Ylonen <ylo@ssh.fi>

.SH SEE ALSO
.BR ssh-add (1),
.BR ssh-keygen (1),
.BR ssh (1),
.BR sshd (8)
