Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Keychain breaks scp
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
heathkit
n00b
n00b


Joined: 23 Apr 2002
Posts: 38

PostPosted: Tue Sep 10, 2002 1:55 am    Post subject: Keychain breaks scp Reply with quote

I put keychain in my .bashrc file. Now, I see that sometimes scp craps out on me. The command authenticates me, then I see keychain come up and it doesn't do anything else. Any idea what's going on? I comment keychain out of the .bashrc and scp works just fine.
Back to top
View user's profile Send private message
arcterex
Tux's lil' helper
Tux's lil' helper


Joined: 30 Sep 2002
Posts: 109

PostPosted: Thu Oct 10, 2002 9:31 pm    Post subject: Wierdness in .bash* files Reply with quote

The solution that I found for this was to move the keychain command out of .bashrc and into my .bash_profile, and then to make sure that it's run in my terminals (I only use gnome-terminal) I changed the command that gnome-terminal runs to /bin/bash --login (in edit->current profile->title and command->run custom command).

Works for me, not the most elegant solution, but it works....

Update
I know there's a way to do it better, but after a bit of mucking about I found that when scping from another box, $PS2 is not set ($PS1 is), and when invoking /bin/bash (ie: not changing gnome-terminal as above) $PS2 is set.

Anyway, I put the following in my .bashrc, and left my .bash_profile as default, and it works. YMMV of course.

Code:
if [ "$PS2" ]; then
   keychain ~/.ssh/id_dsa
   . ~/.keychain/`uname -n`-sh
fi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum