[CentOS] ssh-askpass in bash script

SilverTip257 silvertip257 at gmail.com
Mon Mar 3 03:31:31 UTC 2014


On Sun, Mar 2, 2014 at 2:00 PM, Tim Dunphy <bluethundr at gmail.com> wrote:

> >
> > By what you have said, it doesn't sound like you're caching things in the
> > keyring.  For a day at work, I only ever have to enter my passphrase once
> > (unless I remotely connect to my desktop from another desktop to connect
> to
> > a server).
>
>
> Bingo! That's what I'm after.
>
> I too am using ssh-agent and ssh-add.
>
> I have added ssh-agent to my bash profile so it's automatically ran.  From
> > there I manually run ssh-add and enter my passphrase.  Smooth sailing
> from
> > there.
>
>
>
> Think you could maybe post the lines in your bash_profile to achieve that?
> I've tried everything from what I showed you at the top of the thread to
> just simply adding:
>
> eval $(ssh-agent)
>

That's exactly what I have in my .bash_profile for the agent part

If I wasn't utilizing the GNOME keyring on my desktop (as I do most of the
time), I'd be doing things a bit differently.  That's for sure ;)


> ssh-add
>

I'm using:
ssh-add -t8h /path/to/private-key

The manpage says that when ran without arguments ssh-add picks the default
names ~/.ssh/id_dsa or ~/.ssh/id_rsa, but does _not_ specify a time for the
key to be cached.  I tried excluding the time period and can auth with my
key after disconnecting, but I'm not sure what the caching default time
period is for the keyring.

I also run "ssh-add -D" at the end of my shift so my unlocked keys are
removed from the ssh-agent (and the key is once again locked/requires my
passphrase).


>
> To my bashrc file. Also what's the difference between storing something
> like this in your bash_profile vs bashrc?
>
>
Keith replied back on this one and he's spot on with his response.
-- .bash_profile is executed for login shells
-- .bashrc is executed for interactive non-login shells

I expect the difference there is why you are being prompted each time
(thought I've not tested it yet).

[0] http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html

-- 
---~~.~~---
Mike
//  SilverTip257  //



More information about the CentOS mailing list