[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ssh-agent without graphical display manager? how?

On Sunday 04 January 2009, Paul E Condon <pec@mesanetworks.net> wrote 
about 'ssh-agent without graphical display manager? how?':
>I control it mostly by logging into it
>using ssh.  But when I log in this way, it appears that ssh-agent is
>not started.  Has anyone confronted
>this situation and worked out a solution? Advice?

I use the "keychain" package plus these scripts and snippets to start and 
load my agents:
(Helper scripts)
~/bin/keychain-start.sh: (Meant to be sourced)
#! /bin/sh
# Starts keychain or initializes the environment, but requires no 
if [ -x /usr/bin/keychain ]; then
        eval "$(/usr/bin/keychain --eval --quiet --inherit any-once --stop 
others --noask --lockwait 0 >/dev/null 2>&1)"

~/bin/keychain-load.bash: (Meant to be run normally)
#! /bin/bash
# Starts and loads the keychain, interacting with the user as needed.
# May start gnupg-agent, but doesn't prompt for keys because gnupg-agent
# regularly times out keys.
# Since interaction is clearly available, we clear the keychain before 
# keys (assume user is an attacker).
if [ -x /usr/bin/keychain ]; then
        eval "$(/usr/bin/keychain --eval --inherit any-once --stop others \
                --clear "${SSH_KEYS[@]}")"

~/.kde/env/keychain-start.sh is a hardlink to ~/bin/keychain-start.sh.

~/.kde/env/ssh-askpass.sh: (optional)
#! /bin/sh

if [ -x /usr/bin/ksshaskpass ]; then
        SSH_ASKPASS=/usr/bin/ksshaskpass; export SSH_ASKPASS
elif [ -x /usr/bin/x11-ssh-askpass ]; then
        SSH_ASKPASS=/usr/bin/x11-ssh-askpass; export SSH_ASKPASS
elif [ -x /usr/lib64/ssh/x11-ssh-askpass ]; then
        SSH_ASKPASS=/usr/lib64/ssh/x11-ssh-askpass; export SSH_ASKPASS
elif [ -x /usr/bin/ssh-askpass ]; then
        SSH_ASKPASS=/usr/bin/ssh-askpass; export SSH_ASKPASS
elif [ -x /usr/lib64/ssh/ssh-askpass ]; then
        SSH_ASKPASS=/usr/lib64/ssh/ssh-askpass; export SSH_ASKPASS

[Desktop Entry]
Name=Load Keychain
Comment=Start agents and add keys to them.

if [ -x ~/bin/keychain-start.sh ]; then
        . ~/bin/keychain-start.sh

[[ -t 0 ]] && [[ -x ~/bin/keychain-load.bash ]] && ~/bin/keychain-load.bash

If you use a different shell, then you may need to modify a differnt .*rc 
file and/or a different .*profile file.  If you use a different DE, you'll 
probably have to change the location of the DE files.
Boyd Stephen Smith Jr.                     ,= ,-_-. =. 
bss@iguanasuicide.net                     ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' 
http://iguanasuicide.net/                      \_/     

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply to: