Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 01-25-2005, 06:42 AM   #1
LQ Newbie
Registered: Jan 2005
Posts: 2

Rep: Reputation: 0
Question ssh-agent/ssh-add question

I use slack for a long time and now I've installed 10.0 on my laptop and I can't figure out why my ssh-add doesn't prompt me when I start X.

I use a shell script to run X:

--- cut here ---
SSH_AGENT=`which ssh-agent`
SSH_ADD=`which ssh-add`
X=`which startx`

exec $SSH_AGENT /bin/sh -c "$SSH_ADD <&-; $X"
--- cut here ---

I've tried to change the execution to "exec $SSH_AGENT /bin/sh -c "$SSH_ADD < /dev/null; $X" but still it doesn't show the GUI ssh-add prompt.

Anyone know what's the matter?

Old 01-25-2005, 01:34 PM   #2
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
Here's how I set it up using x11-ssh-askpass:

First download, unpack, compile and install x11-ssh-askpass:
wget h++p://
tar zxvf x11-ssh-askpass-
cd x11-ssh-askpass-
./configure && xmkmf && make includes && make && make install && make
Now we need edit /etc/X11/xinit/xinitrc. Add this before where your desktop gets started at the bottom:
# Register the SSH keys with ssh-agent
ssh-add < /dev/null
# Start the window manager:
If you use Gnome instead of KDE, then it would be:
# Register the SSH keys with ssh-agent
ssh-add < /dev/null
# Start the window manager:
exec gnome-session
Now we need to set the SSH_ASKPASS environment variable and set an alias for startx on startup. There are a couple options here. If you want it to be system wide, ie everyone who uses the box gets prompted, then add the below code to /etc/profile. Otherwise if you're not going to setup keys for anyone else then you can just add it to your ~/.bash_profile or ~/.bashrc file. Here's the code to add:
# Start X as a under ssh-agent
alias startx="ssh-agent startx"
# Set the location of the x11-ssh-askpass binary
export SSH_ASKPASS=/usr/local/libexec/x11-ssh-askpass
That's it. Hope it helps.

Last edited by DaHammer; 01-25-2005 at 01:42 PM.
Old 01-26-2005, 04:09 AM   #3
LQ Newbie
Registered: Jan 2005
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks DaHammer.
I didn't know it was a different app.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ssh-agent, ssh-add and ssh-keygen AND CVS raylpc Linux - General 2 11-19-2008 03:50 AM
ssh-agent alaios Linux - Security 5 05-02-2004 12:24 PM
ssh-agent question podollb Linux - Networking 1 03-29-2004 05:38 PM
ssh-agent podollb Linux - Networking 15 10-16-2003 01:51 AM
Getting ssh-agent to work.. Sonny Linux - Security 16 01-25-2002 07:57 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:07 PM.

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