Jump to content

sftp not working properly [solved]


dude67
 Share

Recommended Posts

Again I turn to you for some help. I'm still a total newbie, but learning...

 

A short while ago you guys taught me how to connect two linux PCs over ehternet (wlan) with sftp. Since then I've used it to move quite a few videofiles from my secondary PC to my no. 1 PC: PVR --[usb]-> PCLOS --[wlan sftp]-> Mandriva 2006.

 

For some odd reason the connection sometime refuses to work (in Mandriva). If I type sftp://192.168.254.1 in Konqueror in my Mandriva 2006 OS, it more often than not refuses the connection stating something like "there was an error while talking to ssh". Mr. Murphy made sure that now it seems to work - couldn't reproduce the problem for demo purposes.

 

I've made sure that the sshd service is running by typing this in konsole as su: "service sshd start".

 

The weird part is that at the same time I can connect from PCLOS machine to Mandriva 2006 without any problems. Everytime I try it, it gives me the log-on pop-up screen as it is supposed to.

 

Both firewalls are configured excactly the same to let ssh through...

 

As so many time before, I ask: What am I missing here?

:o

Link to comment
Share on other sites

i would suggest not using 254 for a pc on the lan but rather for the router

0-255 is the range...can't use 0 or 255 1st ip and last IP is usually used for a lan device

check the logs in /var/logs/messages

to see if hints are there

Link to comment
Share on other sites

I believe you've lost me there... 254 doesn't equal with 255 - nor with 0... Then, I've used these IPs for all the eternity - which is about a few months now. But never-the-less these IPs have been OK so far.

 

And then the log you suggested contains nothing.

 

- edit: typo -

Edited by dude67
Link to comment
Share on other sites

When I get that message I have deleted the rsa key for a machine I cant connect to in /home/username/.ssh/known_hosts and was able to connect after that.

I've made sure that the sshd service is running by typing this in konsole as su: "service sshd start".
Be sure that sshd is running on all machines you want to connect to.

lynchmob

Link to comment
Share on other sites

When I get that message I have deleted the rsa key for a machine I cant connect to in /home/username/.ssh/known_hosts and was able to connect after that.
I've made sure that the sshd service is running by typing this in konsole as su: "service sshd start".
Be sure that sshd is running on all machines you want to connect to.

lynchmob

OK... I checked that .ssh/known_hosts file and the machine I was trying to connect TO has lost it's own IP's rsa... What does that mean and how can I remedy it?

 

The PC I'm trying to connect FROM has both IPs' rsa's there.

 

And yes, I have checked that both PCs are running with sshd service up. I have two PCs and sftp://192.168.254.1 and .2 has worked fine before.

 

A shot in the dark: try fish://192.168.254.1:22

No help there.

 

I'd try making sure it worked via CLI first.

CLI?

Link to comment
Share on other sites

have you tried to ssh into the actual machine from the same machine?

try 1st with 127.0.0.0 if t works then try the machines ip....

 

if thee both work and the other machine can't you might have disabled access from other than localhost or the listenon directivre might only listen on localhost...

Link to comment
Share on other sites

have you tried to ssh into the actual machine from the same machine?

try 1st with 127.0.0.0 if t works then try the machines ip....

127.0.0.0 didn't work, but the own IP of this PC works (asks for user ID and pw).

 

When pinging, all the machines reply without delays (I have these two PCs with WLAN AP in between).

 

Could there be something wrong with the cache of Konqueror? How do I clear cache and other stuff like cookies in Konqueror?

 

It has sometimes helped if I first initiated sftp from the other PC to this one and then tried again. And then again, sometimes it does not help...

Link to comment
Share on other sites

I'm sorry: I misread your instructions - I tried first with sftp... The results are still the same: I cannot connect with ssh to 127.0.0.0 but to 192.168.254.2 (IP of this machine) I can. So what's with that then?

Edited by dude67
Link to comment
Share on other sites

I'm sorry: I misread your instructions - I tried first with sftp... The results are still the same: I cannot connect with ssh to 127.0.0.0 but to 192.168.254.2 (IP of this machine) I can. So what's with that then?

sorry, its 127.0.0.1 (localhost)

However since you can log in locally (recursively) via ssh then its working :D

 

My /etc/ssh/ssh_config contains only

 

 SendEnv LANG LC_*
HashKnownHosts yes

 

Can you ssh from the other machine to the server you are trying to ftp to?

Just try CLI....

 

If you can then its definately the ftp settings which are wrong...

 

you can also try from a cli

sftp localhost

from the machine you are trying to get into

 

if this works then the ftp settings are for localhost only... if not then the general setitngs are not correct.

Link to comment
Share on other sites

I tried different solutions and this is what I get from PC #1 - 192.168.254.2 (FROM which I try to connect with sftp TO the PC #2)

[xxx@linuxpurkki ~]$ sftp 192.168.254.2
Connecting to 192.168.254.2...
xxx@192.168.254.2's password:

[xxx@linuxpurkki ~]$ sftp 192.168.254.1
Connecting to 192.168.254.1...
ssh: connect to host 192.168.254.1 port 22: Connection refused
Couldn't read packet: Connection reset by peer
[xxx@linuxpurkki ~]$

 

This is from the other PC (PC #2 - 192.168.254.1). To me, it gets a bit weird... I cannot sftp that PC itself, but can sftp this PC...

[xxx@kakkospurkki ~]$ sftp 192.168.254.1
Connecting to 192.168.254.1...
ssh: connect to host 192.168.254.1 port 22: Connection refused
Couldn't read packet: Connection reset by peer
[xxx@kakkospurkki ~]$

[xxx@kakkospurkki ~]$ sftp 192.168.254.2
Connecting to 192.168.254.2...
xxx@192.168.254.2's password:
sftp> exit
[xxx@kakkospurkki ~]$

Link to comment
Share on other sites

Now I feel a bit stupid. I swear I had the sshd service up and running but it must have dropped somewhere along the line... I have on earlier occasions verified and double checked that both PCs have ssh running, but the sftp just doesn't work from this PC to the other - but works the other way around.

This time it is my stupidity - sorry folks...

 

What is the easiest way of starting the service when booting the system?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...