LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 12-29-2009, 11:09 AM   #1
Tister
LQ Newbie
 
Registered: Dec 2009
Posts: 3

Rep: Reputation: 0
[SOLVED] libpam-ssh does not unlock keys on wdm/xdm logins (unstable)


Hence no real SSO is possible, but that was the reason I wanted libpam-ssh in the first place.

Logging-in with the ssh passphrase in wdm works just fine, but it does not unlock the keys in ~/.ssh/

Code:
tister@sarevok:~#ssh-add -l
The agent has no identities.
tister@sarevok:~#cat .ssh/agent-sarevok-\:0
SSH_AUTH_SOCK=/tmp/ssh-NBFZzP5130/agent.5130; export SSH_AUTH_SOCK;
SSH_AGENT_PID=5131; export SSH_AGENT_PID;
echo Agent pid 5131;
tister@sarevok:~#ps aux | grep agent
tister    5131  0.0  0.0   4776   956 ?        Ss   17:29   0:00 ssh-agent -s
tister    5155  0.0  0.0   4776   640 ?        Ss   17:29   0:00 /usr/bin/ssh-agent /usr/bin/ck-launch-session /usr/bin/dbus-launch --exit-with-session startfluxbox
tister    5647  0.0  0.0   5064   764 pts/1    S+   17:34   0:00 grep agent
tister@sarevok:~#echo $SSH_AGENT_PID
5155
If I'm reading this right, there is a second ssh-agent running, which started with fluxbox. I'm not quite sure if that's how it's supposed to be.

Code:
tister@sarevok:~#ssh-add 
Enter passphrase for /home/tister/.ssh/id_rsa: 
Identity added: /home/tister/.ssh/id_rsa (/home/tister/.ssh/id_rsa)
Identity added: /home/tister/.ssh/id_dsa (/home/tister/.ssh/id_dsa)
tister@sarevok:~#ssh-add -l
2048 c9:6b:e1:74:1a:e7:d8:97:66:4b:52:44:5d:65:65:41 /home/tister/.ssh/id_rsa (RSA)
1024 ab:9c:4e:77:59:78:84:90:39:0b:d4:39:b4:0e:b7:96 /home/tister/.ssh/id_dsa (DSA)
tister@sarevok:~#
As you can see, I can manually load/unlock the keys. But that is not what I intended.

Both my /etc/pam.d/login and /etc/pam.d/wdm are configured like this:

Code:
auth sufficient pam_unix.so nullok_secure
auth required pam_ssh.so use_first_pass
...
@include common-session
session optional pam_ssh.so
...
When I log in on a terminal the keys get unlocked correctly:

Code:
tister@sarevok:~#cat .ssh/agent-sarevok-_dev_tty3 
SSH_AUTH_SOCK=/tmp/ssh-NBFZzP5130/agent.5130; export SSH_AUTH_SOCK;
SSH_AGENT_PID=5131; export SSH_AGENT_PID;
echo Agent pid 5131;
tister@sarevok:~#ps aux | grep agent
tister    5131  0.0  0.0   4776   956 ?        Ss   17:29   0:00 ssh-agent -s
tister    5155  0.0  0.0   4776   964 ?        Ss   17:29   0:00 /usr/bin/ssh-agent /usr/bin/ck-launch-session /usr/bin/dbus-launch --exit-with-session startfluxbox
tister    6282  0.0  0.0   5064   768 pts/3    S+   17:46   0:00 grep agent
tister@sarevok:~#ssh-add -l
2048 c9:6b:e1:74:1a:e7:d8:97:66:4b:52:44:5d:65:65:41 /home/tister/.ssh/login-keys.d/login-key-rsa (RSA)
which is obviously because logging in from a terminal uses the right ssh-agent. (Note that it's following/using the symlink in login-keys.d this time)

For me, the issue seems to be, that logging in from wdm/xdm (I tested both) starts a second ssh-agent which does not load/unlock the keys. Contrary to loggin in on the terminal, which is working like it's supposed to be.

Now I got two questions:
- How do I tell the second ssh-agent to load/unlock my keys (automatically not manually like I did before)? respectivly
- How to I get rid of the second ssh-agent and use the first one when logging in with wdm?

Any help or hints are very appreciated! This problem is bugging me for days now!
MTIA

Last edited by Tister; 01-04-2010 at 11:12 AM.
 
Old 01-04-2010, 11:11 AM   #2
Tister
LQ Newbie
 
Registered: Dec 2009
Posts: 3

Original Poster
Rep: Reputation: 0
I finally solved my problem.
First I had to disable the second ssh-agent. I done this by commenting out the line
Code:
use-ssh-agent
in /etc/Xsession.options.

After that I had to add in my ~/.bashrc the line
Code:
source ~/.ssh/agent-sarevok
where sarevok is my hostname.

That exported the necessary SSH_* variables in the environment of the bash, each time I open a new xterm.

This might not be the best solution, but it works for me. If someone knows a better solution I'm happy to hear about it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
WDM fails to load properly: wdm-config is blank Paul8032 Linux - Software 0 10-07-2006 03:01 AM
Can't logon to non-root users from wdm,xdm websinger Debian 4 12-20-2004 05:50 PM
xdm and multiple logins? SciYro Linux - Software 4 10-20-2004 08:59 AM
Root & user logins : Passwords? Why not encryption keys instead? furfurdemon666 Linux - Security 4 07-02-2004 09:17 AM
SSH Links Problem With libpam dogn00dles Linux - Networking 2 10-21-2003 12:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 02:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration