All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stef Bon <stef@bononline.nl>
To: Marc Weber <marco-oweber@gmx.de>
Cc: autofs <autofs@linux.kernel.org>
Subject: Re: sshfs and autofs
Date: Wed, 23 Dec 2009 23:31:15 +0100	[thread overview]
Message-ID: <4B329A33.5000901@bononline.nl> (raw)
In-Reply-To: <1261606324-sup-8574@nixos>

Marc Weber wrote:
> Excerpts from Stef Bon's message of Wed Dec 23 22:59:48 +0100 2009:
>   
>> Stef Bon wrote:
>>     
>>> This is the whole problem, because this is not easy. The automounter 
>>> (read man 5 autofs) can offer variables like USER, UID, etc,HOST
>>> of the user requesting the mount (according to the manpage). Then to 
>>> present this user a suitable dialog... maybe via dbus???
>>>       
>> I'm silly here, the user is not the problem, this is already available, 
>> in the options, or - in my construction - in the config file, in the 
>> parameter AUTOFS_USER
>> and in the mountpath, but the environment this user is using! A pid of 
>> the process would be very usefull, for example.
>> But this is not easy. When I'm logged in twice with the same account, 
>> which session should get the question for the passphrase?
>>     
>
> About which session are you talking now? A ssh-agent session determined
> by SSH_AGENT_PID and SSH_AUTH_SOCKET ?
>
> Add this to your .bashrc or .zshrc:
>
> reuseSSHAgent () {
>         local f=~/.current-ssh-agent
>         . $f || true
>         ps -p "$SSH_AGENT_PID" &> /dev/null || {
>                 ssh-agent | grep -v echo > $f
>                 . $f
>                 ssh-add
>         }
> }
> reuseSSHAgent
>
> If there is a ssh agent running it will be used if not it will be
> started. Then ssh-add will be run (I use only one key so this is
> comfortable to me ..)
>
> Maybe I should check that the socket file exists then I would'nt have to
> run ps.
>
> Gentoo has a nice script called "keychain" which provides this and more
> for ssh-agent and the gnu-gpg agent. However I felt it was too bloated
> and replaced it by this function.
>
> You really don't want to type your password twice, do you ? :)
>   
No, but sometimes inevitable.

I'm talking about the usersession. When logged in twice, and I'm 
activating the mount at the second session (or login)
how does the automounter and the mount script know which usersession to 
present a dialog.

This is no issue when you first enter the passphrase manually in the 
first session, make use of it and reuse it on the second.

Stef

  reply	other threads:[~2009-12-23 22:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-18  4:08 sshfs and autofs Marc Weber
2009-12-18 22:01 ` Marc Weber
2009-12-20 15:54   ` Stef Bon
2009-12-21 10:32     ` Marc Weber
2009-12-22 19:08       ` Stef Bon
2009-12-22 21:45         ` Marc Weber
2009-12-23 21:47           ` Stef Bon
2009-12-23 21:59             ` Stef Bon
2009-12-23 22:16               ` Marc Weber
2009-12-23 22:31                 ` Stef Bon [this message]
2009-12-23 22:53                   ` Marc Weber
2009-12-24 14:12                     ` Stef Bon
2009-12-24 23:52                       ` Marc Weber
2009-12-23 22:05             ` Marc Weber
2009-12-23 22:19               ` Stef Bon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B329A33.5000901@bononline.nl \
    --to=stef@bononline.nl \
    --cc=autofs@linux.kernel.org \
    --cc=marco-oweber@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.