Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 276449 - sys-auth/pam_ssh should get keypaths from ~/.ssh/config
Summary: sys-auth/pam_ssh should get keypaths from ~/.ssh/config
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: PAM Gentoo Team (OBSOLETE)
URL:
Whiteboard:
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2009-07-04 11:26 UTC by Michał Górny
Modified: 2009-07-30 12:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Support keyfiles outside ~/.ssh (pam_ssh-1.92-non-dotssh-paths.diff,1.23 KB, patch)
2009-07-04 11:27 UTC, Michał Górny
Details | Diff
Get keypaths from config (pam_ssh-1.92-sshconfig.diff,4.54 KB, patch)
2009-07-04 11:28 UTC, Michał Górny
Details | Diff
Ebuild with patches (pam_ssh-1.92.ebuild,1.19 KB, text/plain)
2009-07-04 11:29 UTC, Michał Górny
Details
Support keyfiles outside ~/.ssh (for 1.97) (pam_ssh-1.97-non-dotssh-paths.diff,1.23 KB, patch)
2009-07-30 08:52 UTC, Michał Górny
Details | Diff
Get keypaths from config (for 1.97) (pam_ssh-1.97-ssh-config.diff,5.42 KB, patch)
2009-07-30 08:52 UTC, Michał Górny
Details | Diff
Diff to add patches to ebuild (pam_ssh-1.97.ebuild.diff,366 bytes, patch)
2009-07-30 08:56 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-07-04 11:26:23 UTC
By default, pam_ssh tries to read key only from default keyfile locations. Although it allows to override these paths using PAM options, such method requires root privileges, applies the path to all users and still doesn't allow user to keep the key outside his ~/.ssh without using symlinks.

I've created two patches to overcome that difficulties. First of them simply allows pam_ssh to read keyfiles from outside ~/.ssh. If keyfile path starts with slash, it assumes it's absolute path and uses it so. If it starts with '~/', it uses it as a path relative to user's homedir. Else (to retain compatibility) it assumes it's path relative to ~/.ssh.

Second patch adds simple ~/.ssh/config reading support. With it, pam_ssh tries to get additional (to default ones) keypaths from the 'IdentityFile' configvars. The parser is quite dirty although.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-07-04 11:27:20 UTC
Created attachment 196609 [details, diff]
Support keyfiles outside ~/.ssh
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-07-04 11:28:13 UTC
Created attachment 196611 [details, diff]
Get keypaths from config
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-07-04 11:29:21 UTC
Created attachment 196612 [details]
Ebuild with patches
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-07-04 22:35:43 UTC
I think the patch should probably get submitted upstream, as you are the author, would you please do that?
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-07-05 00:11:02 UTC
Ok, I've dumped the patch for pam_ssh-1.97 and submitted it upstream.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-07-30 08:52:08 UTC
Created attachment 199621 [details, diff]
Support keyfiles outside ~/.ssh (for 1.97)
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-07-30 08:52:52 UTC
Created attachment 199623 [details, diff]
Get keypaths from config (for 1.97)
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-07-30 08:56:59 UTC
Created attachment 199625 [details, diff]
Diff to add patches to ebuild
Comment 10 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-07-30 11:24:42 UTC
Since this is a feature request and we/I are already swamped as it is, please do submit this upstream, once they merge it in and release I'll bump and get it in Gentoo.
Comment 11 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-07-30 12:09:51 UTC
(In reply to comment #10)
> Since this is a feature request and we/I are already swamped as it is, please
> do submit this upstream, once they merge it in and release I'll bump and get it
> in Gentoo.

I've already done that but upstream doesn't seem responsive (no activity since 100+ days).
Comment 12 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-07-30 12:14:36 UTC
That's a very good reason for which I don't want to have a fork in Gentoo.