Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
why use ssh-agent and keychain
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
flazz
Guru
Guru


Joined: 22 Nov 2003
Posts: 496
Location: Florida

PostPosted: Wed May 10, 2006 4:41 am    Post subject: why use ssh-agent and keychain Reply with quote

i'm reading the keychain guide and i dont really see a reason for this. could someone explain to me the benefit of using these programs when as long as i have the keys set up in the traditional way all i have to do is 'ssh computer'.
Back to top
View user's profile Send private message
jk3us
Apprentice
Apprentice


Joined: 14 Mar 2005
Posts: 201
Location: Memphis, TN

PostPosted: Wed May 10, 2006 4:51 am    Post subject: Reply with quote

It is considered good practice to put a passphrase on your ssh keys. If you do this, then every time you 'ssh computer' you will be prompted for your passphrase. ssh-agent/keychain allows you to enter your password once for a session and ssh-agent decrypts your key and stores it securely in memory so that you do not need to enter your passphrase each time.
Back to top
View user's profile Send private message
benster
n00b
n00b


Joined: 30 Nov 2005
Posts: 67
Location: Funkytown

PostPosted: Wed May 10, 2006 5:27 am    Post subject: Reply with quote

I think the difference comes down to whether or not you use a passphrase with your private key. If you do, then you still have to enter in a password to decrypt the local private key before it may be used with your connection. The benefit to ssh-agent then is that it keeps your secret key (unencrypted by the passphrase you entered only once) cached (and available to applications you start from that shell or X session) so that you don't have to enter that single password for the secret key every time you use ssh public key authentication to another machine.

But if you're like some people I know, then you have no passphrase at all on your secret key and then the benefit presented by ssh-agent as far as single-link SSHing goes is only one of a little security (assuming your password is good).

But what is cooler is SSH Agent Forwarding. Described in this SecurityFocus article, ssh-agent can also do multi-hop forwarding, so no matter what convoluted web of SSHing you do from your client to remove machine and further sshing from the remote machine to others, you only need the secret key to reside on the client - successive multi-hop ssh sessions all talk back securely to the original client to authenticate. So you only need one copy of the secret key. So if you SSH to a firewall machine and then into a real machine inside the firewall on a LAN from outside, ssh-agent could help you not need a copy of your secret key on the firewall machine, but just on your client machine.

So if you have some convoluted ssh'ing going on, then ssh-agent seems like it could be a useful thing. But if you're just one-hop sshing to other machines, and if you're willing to not use a passphrase for you key, then you don't need ssh-agent. But if your box gets rooted and your secret keys aren't passphrased, the intruder now has access to all the machines you setup passwordless public-key ssh with. Depends on how paranoid you're feeling.
Back to top
View user's profile Send private message
flazz
Guru
Guru


Joined: 22 Nov 2003
Posts: 496
Location: Florida

PostPosted: Wed May 10, 2006 3:55 pm    Post subject: Reply with quote

excelent responses, thanks

my biggest problem with using passphrases is that i have automated scripts that get output from remote commands and as far as i know there is not way to enter the passphrase or password as part of a command line ssh call.

a cron example example:
Code:
ssh box "tail /var/log/messages|awk -f scriptThatParsesAndAlerts"

if i have a password this will never work because it will just wait and wait till timeout.

but i do like the idea of one key for a multihop sesison, i dont have any scenario where i multihop right now but i might soon, its a brilliant concept.
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Wed May 10, 2006 5:57 pm    Post subject: Reply with quote

flazz wrote:
excelent responses, thanks

my biggest problem with using passphrases is that i have automated scripts that get output from remote commands and as far as i know there is not way to enter the passphrase or password as part of a command line ssh call.

thats what keychain is for.
You only need to enter the passphrase *once* for a given key. After that any process on your machine can source this memory-resistant information afterwards (until the next reboot that is).
So you can have both... key-auth plus a secured key.
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum