Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
scp strange behavior
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
eunuque
n00b
n00b


Joined: 19 Aug 2003
Posts: 62

PostPosted: Fri Feb 06, 2004 10:04 pm    Post subject: scp strange behavior Reply with quote

Hi all,

I'm using scp between a gentoo (192.168.0.1) and a redhat9 (192.168.0.10) boxes.
It's working only for transfers initiated by my gentoo box. Overwise scp aks for the password and then freezes.

Download from gentoo is fine:
Code:
toto@gentoo# scp toto@rh:test_file .
toto@192.168.0.10's password:
test_file                                     100%    0     0.0KB/s   --:-- ET


Upload from gentoo also:
Code:
toto@gentoo# scp test_file toto@rh:
toto@192.168.0.10's password:
test_file                                     100%    0     0.0KB/s   --:-- ET


But download/upload from rh freeze:
Code:
toto@rh: scp toto@gentoo:test_file .
toto@192.168.0.1's password

... and then nothing !

Note that I made these tests after /etc/init.d/iptables stop to be sure it was not a firewall isssue.

Any help?
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Fri Feb 06, 2004 10:10 pm    Post subject: Reply with quote

Does your toto@gentoo account run some commands or print out some fancy motd during login? I mean, did you add something to its ~/.bashrc, ~/.zshrc or some file like that?
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
eunuque
n00b
n00b


Joined: 19 Aug 2003
Posts: 62

PostPosted: Sat Feb 07, 2004 11:11 am    Post subject: Reply with quote

Thanks!!!

The problem came from a change I made in my .bashrc:

Code:
# We restart the login shell one time because of french accents
if [ "$SHLVL" == '1' ]
then
    exec /bin/bash --norc
fi


I have absolutely no idea how scp interacts with the remote shell and in my case with .bashrc, but this made scp freeze...

I reinforced my test so that it also checks for $PS1 (which apparently is not defined during a scp command). I'm not really proud of this workaround but at least it now works:

Code:
# We restart the login shell one time because of french accents
if [ "$SHLVL" == '1' ] && [ "$PS1" != "" ]
then
    exec /bin/bash --norc
fi
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Sat Feb 07, 2004 11:19 am    Post subject: Reply with quote

Fantastic. :) Your workaround seems to be fine.

I also don't know what exactly makes scp break and what not, but after struggling with this issue by myself too, nowadays when scp fails the absolutely first thing I check is my login stuff.
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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