LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


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

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


Hi,
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 ---
#!/bin/sh
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?

Thanks,
Cristina
 
Old 01-25-2005, 12:34 PM   #2
DaHammer
Member
 
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:
Code:
wget h++p://www.jmknoble.net/software/x11-ssh-askpass/x11-ssh-askpass-1.2.4.1.tar.gz
tar zxvf x11-ssh-askpass-1.2.4.1.tar.gz
cd x11-ssh-askpass-1.2.4.1
./configure && xmkmf && make includes && make && make install && make install.man
Now we need edit /etc/X11/xinit/xinitrc. Add this before where your desktop gets started at the bottom:
Code:
# Register the SSH keys with ssh-agent
ssh-add < /dev/null
# Start the window manager:
startkde
If you use Gnome instead of KDE, then it would be:
Code:
# 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:
Code:
# 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 12:42 PM.
 
Old 01-26-2005, 03:09 AM   #3
mega
LQ Newbie
 
Registered: Jan 2005
Posts: 2

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

Cristina
 
  


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

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

All times are GMT -5. The time now is 01:23 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