On Tue, Feb 25, 2003 at 12:19:45PM +0100, dick hoogendijk wrote:
> For bash I can use .bash_profile and .bash_logout to get things done at
> login/logout time.
>
> On my fbsd machine I use /bin/sh and I can't find how to execute things
> at logout time (login is set in .profile). I.e. I want to remove the
> ssh-agent pig at logout time and clear the screen)
>
> Does /bin/sh has a logout file ??? and if so, what's it called?
Hmmm... I don't think that /bin/sh does have a logout script.
However, you may still be able to use ssh-agent using the alternative
syntax. You can tell ssh-agent to spawn another command, which is
usually used for something like a window manager.
Try putting a line like this at the end of your .profile:
exec ssh-agent /bin/sh
which should put you into your usual shell running as a child of the
ssh-agent. Once in, check your environment: there should be
SSH_AUTH_SOCK and SSH_AGENT_PID environment variables. The ssh-agent
will run until you exit from the shell, and you can load keys into it
as normal.
Warning: make sure you have an alternate login you can use to fix your
account if this all goes horribly wrong and stops you being able to
log in at all. I haven't tested doing anything like this myself, so I
really don't know if it will work properly or not.
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks
Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey Marlow
Tel: +44 1628 476614 Bucks., SL7 1TH UK
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message